Software engineering is design all the way: code as design

2011-02-12 22:23:31 +0100

Recently I came across an article I remember reading quite some years ago and having quite an influence on my thinking.
A short summary in my own words. Creating software is usually viewed as a form of engineering, hence the name software engineering.  Engineering consists of designing constructs and building them. What exactly is then programming? In engineering of products like hardware, house-hold devices, bridges, or houses - hard products- first a design is created, then a the actual product is build. How can engineers know if they're design is correct? They create mock-ups, use calculations and their knowledge to verify correctness of their design (nowadays usually with help of software) and show mock-ups and visualizations of design to end-users, product managers, marketing or other people involved.
Finally they have the product actually build by robots or contractors. Many people, even many software developers think programming is part of the building phase. Is this correct? Programmers write code and frequently use their IDE, compiler, automatic unit tests to verify the correctness. Then, they'll show the outcome to all parties involved. When all is good, the software is packed and installed to servers or pressed on CD-ROMS to made available to the public. When comparing to other enginering jobs as listed above, these tasks are all part of the design task, except maybe for the part of releasing/publishing (which is often not done by the software engineer but by either an automatic process or a system administrator).  So all in all software engineering, as well as programming, is design all the way.

See code as design for the source.

Read more

Enabling accesskeys for javascript events

2010-12-29 17:48:43 +0100

Using the accesskey attribute, you can enable hotkeys for various html input elements. This allows one to get the focus to an input element by using the ALT-key + <CHARACTER> (on Windows) or CTRL-key + <CHARACTER> (on Mac). This way, your page is accessible by keyboards besides mouse.

Here's the example taken from the Mozilla DevCenter:

  <label value="Enter Name" accesskey="e" control="myName"/>
  <textbox id="myName"/>
  <button label="Cancel" accesskey="n"/>
  <button label="Ok" accesskey="O"/>

Both buttons as well as the input box can be accessed by ALT+E, ALT+N, ALT+O on Windows or CTRL+E, CTRL+N or CTRL+O on a Apple-Mac.

This is quite easy to program, and works for all popular browsers (including Internet Explorer, Safari or Firefox).
There might be cases where you want to execute some javascript when an accesskey is hit, for example to fire a java-event. Almost all webapplications use javascript one way or another. Fortunately, you don't not complitated key-event-handling javascript to do that, just use an empty link:

<a href="#" accesskey="y" onclick="some javascript"> </a>

The javascript is executed when the acesskey is hit, this case an ALT+y on Windows. The link is not displayed, so you're free wetter or not to display a button, link or anything within your web-application.

Read more


subscribe via RSS