Fog Creek Software
Discussion Board

The Poetry of Programming -- design examples

In The Poetry of Programming ( ), Richard Gabriel of Sun says:

"... what do people do when they're being trained, for example, to get a Master of Fine Arts in poetry? They study great works of poetry. Do we do that in our software engineering disciplines? No. You don't look at the source code for great pieces of software. Or look at the architecture of great pieces of software. You don't look at their design."

Can anyone site some great examples of well written / designed code? I'm particularly interested in C++.

Saturday, February 8, 2003

I meant 'cite', not 'site'.

Saturday, February 8, 2003

[writing software is a creative activity that requires a lot of interaction with the people who are going to use it. Writing software is a highly iterative, dynamic process requiring user feedback.]

That's a quote from the article. I have always felt this way but it's so frustrating that most people don't seem to understand.
By the way, I don't consider myself simply a programmer. Including my past careers and education, and my hobbies, I'm a visual artist/ linguist /psychologist /musician-songwriter /programmer. There is not a single person I have ever spoken to who has any idea why this makes sense.
I understand what this guy is saying about programming being like writing poetry. I admit I don't get much chance to write the kind of highly complex and advanced programs he's probably talking about. But I know how it feels to write music and lyrics, or to paint pictures, and I know I get a similar feeling when coding. I have also done scientific research and I feel that programming resembles science as well as art (debugging is like experiementing). It's the only thing I've ever done that combines creative writing, science, and practical usefulness.
Donald Knuth has also made comments about programming being creative, like composing music. But I don't know any programmers, including on this forum, who feel this way.
And my friends and relatives have absolutely no idea why I went from art to linguistics to programming. They can't see any connection whatsoever.
And the programmers where I work have no concept of interaction with users. They spent years on a system only to find out the users hate it. They are thinking like engineers, not like artists.

Saturday, February 8, 2003

I think programming is more like a craft than science or art.

Saturday, February 8, 2003


the C++ with templates implementation is quite amusing


Sunday, February 9, 2003

I'm not sure there's much consensus about what the great works of software are. It might be more straightforward to choose software which has been useful and successful. Arguably it could play the same role as the real-world schematics you can find in some EE books: not necessarily great art, but useful information about how nontrivial things have been accomplished reasonably successfully in the past.

It's particularly easy and convenient to look at free software. There's a large amount of nontrivial free software out there to look at, including some which started out non-free (like Doom:-). Unfortunately (since you said you're particularly interested in C++) only a small proportion of it is written in C++. A small proportion of a large amount should still be a significant amount of code, but offhand I can't think of a particularly successful or long-lived free C++ project to suggest. Lots of C, though, including the GNU tools, net tools like apache and bind, the various free Unix-alikes, libraries to do everything from databases to numerical integration to graphics to crypto, chess-playing programs (gnuchess and crafty, off the top of my head), and compilers and interpreters for many other languages.

William Newman
Sunday, February 9, 2003

It has been suggested that musical training is the reason so many great physicists came out of pre-war Germany (Einstein, Bohr, etc. both amateur musicians).  Music causes many different centers of the brain to work together simultaneously.  These synapses are then brought into play later in life when a person is engaged in other non-musical activities. 

Still there is a point where the Arts and programming diverge.  The arts have an emotional content that I have not been able to find in computer programming.  Studying the life of a composer sheds insight into the emotional content of a musical work.  This is less relevant in computer science, making it less likely that someone would study the life of Knuth the way someone might study the life of Brahms. 

(And of course musical training != Science training.  At some point the musician must study science.)

Ran Whittle
Monday, February 10, 2003

No one has problems with architecture being both a science and an art - after all a building built with concern only for the artistic will fall down in a few days and a building built with concern only for engineering needs will be efficent but too ugly to stand the sight of.

So why can't software be the same? On a superficial level it obviously is when we talking about code plus UI being what the user thinks of as "software".

Robert Moir
Monday, February 10, 2003

What is considered a programming work of art today is a piece of garbage tomorrow. 

Writing code is not an art form, although it has been proven that people who are music incline are usually mathematically incline and very logical in their thought process, which does make for a better programmer. 

But then again what the heck do I know.

Monday, February 10, 2003

Perhaps another way to gain insight into the quality of one's code is to try pair programming (if only for a while), especially with a more experience partner.

Formal code reviews might also be a useful method.

Oh darn, I answered a technical post...

Sherlock apt to look foolish outside his domain

Monday, February 10, 2003

This question of the boundary between art and craft is a very old question.  Inevitably each person will answer for themselves.  There is no absolute reason why a work of software cannot be both art and science.

Generally speaking though, a thing needs more than simply to be clever in order to be widely perceived as art.  There has to be some celebration of human existence about it.  Perhaps it causes us to think, perhaps it causes us to feel, but generally it must appeal to our humanity in some way that inspires a reaction.  That is a lot to ask of a computer program.

Programs exist as a gigantic series of 32-bit integers that are meaningless to everyone except the computer processor itself.  The structure of the precompiled code and the craftmanship behind it is a private experience of the developers that is not shared by the audience for the software.  The Woolworth Building, by contrast, exists as a large, ornate structure that demands a human reaction from all who experience it (regardless of whether or not they were involved in its construction). 

Software may one day do that as well, but so far it has not.

Ran Whittle
Monday, February 10, 2003

I don't code much C++ these days, but the last time I was genuinely impressed with any C++ code was while reading Alexandrescu's Modern C++ Design ( ) -- some real gems there.

Ken Dyck
Tuesday, February 11, 2003

*  Recent Topics

*  Fog Creek Home