Curiosity Corner


By Chris Douce

The following essays by Jack W. Reeves offer three perspectives on the notion that that programming is fundamentally a design activity and that the only final and true representation of the design is the source code itself:

This sentiment reminds me of something that Mark Weiser of program slicing fame once wrote: that source code should be considered first, foremost and always (I may be paraphrasing) since this is what is really executed on a system. (You sometimes can't trust the comments)

Within vehicle manufacturing, there was once the phenomenon of the 'friday afternoon' car - one which was built whilst the engineers attention was elsewhere, usually about what to do on a Friday night. Thankfully the 'friday afternoon' phenomena has just about disappeared in motor manufacturing.

I couldn't help remembering this friday phenomena when a colleague told me about this website:

The following code (apparently) checks to see if a number is negative:

  If (Mid(CStr(cppObject.GetValue()), 1, 1) = "-") Then ...

I think this submission must be a hoax. Even if it is, there is seriousness that can be found in this site: I urge all practiving software developers to review the code found here - it is a fantastic museum of the pathological and a shrine to the Friday Afternoon Function. (So far I haven't seen any of my source code submitted - give it time...)

Most of the samples are likely to be viewed out of context (although I have to admit generating HTML tags from an SQL stored procedure is asking for trouble!)

Little is known about the history of the code presented. True, these fragments may represent extreme illustrations of conceptual entropy (due to continual of gradual maintenance until the boundaries between files, functions and packages dissolve) but may also represent true pathogens, complicating future maintenance, making problem solving and corrections harder to action.

Sometimes it may be difficult to see which is which until we begin to explore the ecology of the environment where software exists and begin prising apart associations using the tools that we have at our disposal.

This site raises some rather interesting questions about software aesthetics. There is little doubt that some of the samples are considered to be horrors, but what criteria do we apply to make such a judgement?

It can be said that coding horrors can have a number of dimensions - maintainability and efficiency for example. The importance between these dimensions may change, of course, according to application area.

McConnell uses an interesting quote by Plauger in Code Complete : 'one symptom that you have bogged down in complexity overload is when you find yourself doggedly applying a method that is clearly irrelevant, at least to any outside observer.'

This reminds me of another annual event that has been going only slightly longer than PPIG has:

I recommend that you have a glance over the goals of the competition. Some of them are particularly noble.

A posting on Slashdot recently announced that an essay by Gerald Weinberg entitled 'Personal Chemistry and the Healthy Body' was recently republished in the Developer Dot Star magazine. This Slashdot submission was contextualised by the the 'programmer abuse' website:

This lies in a genre of sites similar to the dailywtf site. Although many of the comments may immediately come across as general gripes and whinges (like we all like to do from time to time, especially on a cold winters morning), some of this miserable bunch of whingers may indeed have something very insightful to say about the disasters that they work on.

I conclude this section of Curiosity Corner with a link to a web-log. This web-log includes a familiar image to those who may be familiar with the reviewed text:

I don't normally read web-logs but this one does look quite good fun.

A faculty member of a university in which I was recently working distributed the following link. (Please excuse this fine example of viral advertising. In the current context it's too good to miss.) Apparently no cats were harmed during the making of the ad and as far as I know the cats chose to herd themselves at a time of their own choosing, totally oblivious to the directors deadlines:

On a more serious note, London Metropolitan University has developed a number of reusable learning objects that help to teach some of the principles of programming. More details of this work can be found at the project website:

The sample objects accessible from this website will be of interest to those researchers (and engineers) who construct (and evaluating) algorithm animation systems for use within both education and industrial applications. (I particularly recommend that you have a look at the while loop object).

The London Metropolitan Learning Technology Research Institute website can be found here:

Continuing a didactic theme, one of the tasks that computer science (or should it now be called informatics?) lecturers have to do is evaluate student's programming assignments. In the UK where student numbers in higher education have been increasing for a number of years, the problem of assessment can become seriously non-trivial.

Recalling that one of the attributes of a good programmer or software engineer is laziness (see The Pragmatic Programmer and, of course Code Complete), help is at hand in the form of three student programming assignment assessment systems. Three of which are detailed below:

In developing these automated systems the engineers have to consider how lecturers assess the work of others. In programming systems, the simplest check is to ensure whether a system operates as described with a potentially linguistically ambiguous requirement specification. Secondly, does the submitted software design resemble in any way an ideal solution? Finally, one may wish to consider programmatic efficiency in terms of memory usage or processor time. (Remember, there is more than one way to skin a cat).

The programming assessments that are given to students are unlikely to be 'wicked' problems. Returning to Code Complete again these are problems which can be only clearly defined by beginning to solve it either in whole or in part. The terms of programming assignments are not usually changed before they are due to be handed in (although I have heard this approach described at an earlier PPIG meeting by one CS educator).

There are some particularly 'wicked' problems out there, and some of these are often debated by the British Computer Society. Some of these debates may be of particular interest to PPIG readers:

Not so long ago I recently discovered another book that may to be of interest to PPIGers: Code Reading - The Open Source Perspective. Whilst I haven't had time to read it myself here's a link to a review of the book from someone who has:

Continuing this final section where we read about what others have read (a meta-review?) Derek Jones also directs us to a relatively new site which allows you to find interesting papers which have been discovered by like minded people.

These curiosities complete with a topic which appears to be of perenial fascination: a family tree of programming languages. Here are two interesting equivalents - one for the horizontally challenged, the other for the vertically challenged: