Saturday, June 14, 2008

Example of software affordances - level of match between code-form and data generated

Here's an example of software affordances, in this case programming language affordances. Languages have affordances concerning how much the form of the code matches the form of the data generated, as Reg Braithwaite explains (see that article for concrete examples):

one way to write code that is comprehensible is to make sure that the form of the code matches the data the code generates. This is a very general principle, it can be found in web templates (like PHP and ASP pages), markup builder libraries, and even String or List Interpolation.

Features that support this style of writing code are more than simple syntactic sugar, because they alter the reader's mental model, lowering the semantic distance between the code and the code's result.
Braithwaite touches on the issue of IT people tending to look at software in exclusively-functional terms, referring to those people who would say that such differences between languages are just matters of syntactic sugar:
It's more than just syntactic sugar. People have a habit of saying "syntactic sugar" in a dismissive way. It’s another argument that since an underlying language is Turing Equivalent, there is no need for a particular language feature.

1 comment: