TITLE: Two Snippets, Unrelated? AUTHOR: Eugene Wallingford DATE: September 21, 2005 8:22 PM DESC: With my current teaching assignment, discussions of speed and beauty in software development naturally bring to mind Scheme. ----- BODY: First... A student related this to me today:
But after your lecture on mutual recursion yesterday, [another student] commented to me, "Is it wrong to think code is beautiful? Because that's beautiful."
It certainly isn't wrong to think code is beautiful. Code can be beautiful. Read McCarthy's original Lisp interpreter, written in Lisp itself. Study Knuth's TeX program, or Wirth's Pascal compiler. Live inside a Smalltalk image for a while. I love to discover beautiful code. It can be professional code or amateur, open source or closed. I've even seen many beautiful programs written by students, including my own. Sometimes a strong student delivers something beautiful as expected. Sometimes, a student surprises me by writing a beautiful program seemingly beyond his or her means. The best programmers strive to write beautiful code. Don't settle for less. (What is mutual recursion, you ask? It is a technique used to process mutually-inductive data types. See my paper Roundabout if you'd like to read more.) The student who told me the quote above followed with:
That says something about the kind of students I'm associating with.
... and about the kind of students I have in class. Working as an academic has its advantages. Second... While catching up on some blog reading this afternoon, I spent some time at Pragmatic Andy's blog. One of his essays was called What happens when t approaches 0?, where t is the time it takes to write a new application. Andy claims that this is the inevitable trend of our discipline and wonders how it will change the craft of writing software. I immediately thought of one answer, one of those unforgettable Kent Beck one-liners. On a panel at OOPSLA 1997 in Atlanta, Kent said:
As speed of development approaches infinity, reusability becomes irrelevant.
If you can create a new application in no time flat, you would never worry about reusing yesterday's code! ---- Is there a connection between these two snippets? Because I am teaching a course in programming languages course this semester, and particularly a unit on functional programming right now, these snippets both call to mind the beauty in Scheme. You may not be able to write networking software or graphical user interfaces using standard Scheme "out of the box", but you can capture some elegant patterns in only a few lines of Scheme code. And, because you can express rather complex computations in only a few lines of code, the speed of development in Scheme or any similarly powerful language approaches infinity much faster than does development in Java or C or Ada. I do enjoy being able to surround myself with the possibility of beauty and infinity each day. -----