Programming Language Engineering

ziggy on 2002-04-22T18:25:50

Lambda the Ultimate has a link to an interesting presentation from a tools conference in 1999.

The premise is that engineering for human factors is quite important: understand how people use tools and optimize for that use. For example, if a car has cup holders, they should be within reach of the passengers, preferably with one within reach of each passenger. On the other hand, there's a very serious problem with a multi-level parking garage that has traffic going both ways in a single-width lane, or doesn't label which one direction cars should be moving within a single-width lane.

The presentation describes common errors that crop up in programming due to poor language design. For example, what are exceptions supposed to signal, and when should they be used? (Kernighan and Pike mention that exceptions should be exceptional. Throwing an exception because you are trying to read past end-of-file is not an exeptional condition.)

All in all it was very thought provoking. Naturally, older languages like C and Scheme got short shrift because they punt too often (making the languages easier to commit annoying and common errors that are should be easily avoided). It shouldn't be surprising that languages like Eiffel, Ada and Java did get high marks for the idiot-checks designed into them at the language level.

Of course, there is no one perfect language, yet. But it's important today to go past DWIM and craft languages that naturally catch common and obvious mistakes.