Dr. Dobb's Journal January, 2005
Programming languages are the biscuits-and-gravy of software development. Of course, if all you do is follow the tabloids, you'd think that when it comes to programming, there's only something called "C++," another something called "Java," and something that used to be called "COBOL." In truth, there aren't just three or four languages, but hundreds of them. Why, in this issue alone, we cover 15 or so languages, ranging from the familiar (Java, C++, Perl) to the relatively arcane (D, AMPL, and Jcl), with a whole lot in between (Ruby, Python, C#).
Of course, many languages are closely related to each other, sharing similar vocabularies and grammatical rules, not to mention monikers. In the C realm, for instance, there's C, C++, Ch, SystemC, Cg, Cyclone, C99, Objective-C, MeldC, DSP-C, and C++/CLIand that's just for starters. There's also Coffee, Cocoa, and Curl, although the most they share with other C-variant languages is the first letter of their names. And if that's not enough, new languages pop up every day. Recent entries include Fabl, Comega (also called "Cw"), Xen, Groovy, Pluk, Euler, Heron, Scala, MPD, Mila, and more. Whew! Shoot, former DDJ technical editor David Betz ("the king of little languages") used to crank out languages like XLisp, XScheme, Bob, and Drool just for fun.
There are any number of reasons for this neverending interest in new programming languages, foremost among them, according to Pragmatic Programmers Dave Thomas and Andy Hunt, that "different languages solve the same problems in different ways." The old "right tool for the job" scenario, in other words. They go on to say that "by learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut." That's why Dave and Andy encourage you to learn at least one new programming language a year.
Experienced programmers already know this. According to a study we conducted, 97 percent of master software builders and architects routinely work with multiple (two or more) programming languages. Good managers understand this, and not only look for architects who are fluent in multiple languages, but encourage exploration into languages that better suit the task at hand.
One way to learn a new language, of course, is to compare it with a language you already know. And one place to start with is Oliver Schade's "99 Bottles of Beer: One Program in 621 Variations" web site (http://www.99-bottles-of-beer.net/). Arranged alphabetically from A+ to ZZT, Oliver has collected, over the past couple of years, hundreds of implementations of that awful school bus song "99 Bottles of Beer on the Wall." If you'd like to make a contribution for, say, the W or EPL languages, drop Oliver a note.
Likewise, Frank Bu§ reported on the results of a programming challenge he recently devised (http://www.frank-buss.de/challenge/index.html). In a nutshell, his Triangle Challenge required that you write a program that counts all triangles in a figure. Interestingly, the submitted solutions to the challenge included implementations in Lisp, Ruby, Java, C, C++, Haskell, Scheme, Python, Kogut, J, AWK, JavaScript, Matlab, SQL, SETL2, D, Prolog, and OCamlbut mostly in Lisp. In each case, Frank provides the source code (with commentary) so that you can compare not only, say, Lisp to Ruby, but Lisp to Lisp.
In this spirit, we're teaming up with Frank for a second programming challengethis one focusing on a hypothetical Mars Rescue Mission (http://www.frank-buss.de/marsrescue/index.html). In this case, we'll be looking for the shortest solution. The programming language is up to you. The more esoteric, the better, as far as I'm concerned, although that may only get you brownie points. Remember: The shortest path from A to Z is what counts. All solutions must be submitted no later than February 1, 2005, and we'll publish the results in our Algorithms issue (as well as online). To make it interesting, the top five submissions will receive copies of Dr. Dobb's CD/Release 16, which includes archives from January 1988 to December 2004. Again, for details see http://www.frank-buss.de/marsrescue/index.html. Good luck. Who knows, maybe you'll even have to create a new language to solve the challenge.