A Programming Language Rant

Posted in Personal, Technology by Thomas Themel on February 10, 2007.

I just spent most of three days ripping through 60 Project Euler problems, mostly in Common Lisp. As I’m typing this, I’m trying to work up enough motivation to get back to my C language work. And a couple of minutes ago it suddenly dawned on me that I actually have to take a FORTRAN (yes, not hey-did-you-know-there’s-case-to-letters-Fortran 9x, but real live all-caps seventies FORTRAN) course next semester. I read through the lecture notes and already writhe in agony at the sheer ugliness of what I see. Hey, there’s an explicit mention of the fact that when calling a subroutine in FORTRAN, the name of the parameter in the call does not have to be the same as the name of the formal parameter. How smart is that? It must have been the language innovation of the year back in 1957. And hey, you can have something like global variables. Except that you have to declare them in every single subroutine. With exactly the same specification. Oh my god. And when you start researching the reasons why anybody would still use, much less teach, FORTRAN, it becomes really depressing.

See, the reason for this is that there’s a huge legacy of scientific code in FORTRAN. And since almost all coding on these giant heaps is done by people who are (a) not trained programmers and (b) only on the project for a year or two while working on some kind of thesis, this code is probably among the worst nightmares of a software engineer. The sense of hopelessness that this situation fills me with can barely fit words. Yeah, it’s the same problems that enterprise software faces, only there’s no money to be made fixing it, and nobody cares about the cost of grad student coding time, so everybody keeps adding layers to the existing FORTRAN piles instead of moving on. Since everyone in scientific computing uses FORTRAN, it must be the best language for scientific computing, and everybody keeps using FORTRAN. FORTRAN is fastest (because the compilers have been tuned for 40 years, for heavens sake), so we must keep using (and optimizing) FORTRAN. Dijkstra is dead, and FORTRAN still lives. FORTRAN will crush my dreams…

Enough already. I think it was Clemens Früwirth who told me that one of the hazards of learning Common Lisp would be that your day job language would suddenly feel much more awkward than before, and he was right. Still, the looming shadow of FORTRAN makes me appreciate what I have in C, limited as it may be.

Project Euler

Posted in Link Spam, Personal, Technology by Thomas Themel on February 8, 2007.

After finishing the first of two exams scheduled for February, I decided to actually take some time off university. A forum post led me to discover Project Euler, a collection of programming challenges that fill the leisure window quite nicely. As of this writing, I’m 26% done, placing me somewhere around #500 overall and #3 among the (declared) Austrian contestants.

The first couple of problems were almost too easy to be interesting, but right now I’m starting to encounter some that actually require some brain power and not only access to a proper programming language (ie Common LISP) and a math application.

Hey, did you know that the seventeenth number with at least two digits that can be written as a power of its digit sum is 612220032? Somehow, I’m starting to feel that finding the thirtieth number with this property by brute force might not be the best approach…