Language Comparison Example Stink
Monday
Sep 21, 2009
5:00 am
Is Ruby better the Lisp? There are lots of ways and reasons to answer questions like this. Some people rightly find the argument banal sense there are so many different values and reasons at play. I personally enjoy such comparisons. The give me a view of how other people code, and different things that can be done in different ways.
My problem is that so often the examples that are chosen show me nothing. They are so small as that they are almost pointless, and if I haven't ever seen something done before, I have no clue why I'd want to do it. My opinion is that articles like this should have one small, but useful example written in both languages. This example should actually solve a problem someone might care about, and it should not be the key idea of either language.
If you read the sample above it is comparing Ruby (favorably) to Lisp. I use ruby, and I know what features like blocks and lambdas can do in for me. On the other hand manipulating S-expressions sounds like a nifty ability, but I have no idea how to use it to actually get stuff done, and none of the examples are complete enough to demonstrate why this is a killer feature.
If I where new to ruby, the terse blocks in this article would look like line noise. Come on folks, single character variable names are for console hacking and 80's retro code. There is a difference between concise (number of expressions) and terse (number of characters) code. Perl always wins the latter and it is a Pyrrhic victory. You would think Lisp hackers of all people would know this.
Another think that is often done is to take the "core idea" of a language and contrive a problem that best exploits that idea. For example Lisp example are forever processing lists, how about an example about handling a http request, or manipulating a data store. Haskell examples always involve transforming a static piece of data, how about a network interface example, or simple GUI. Any ruby example that requires Rails has already conceded the need for megabytes of library code to get anything done without showing anything about the real value of the language.
I hope people will keep comparing languages. There is a lot of insight that can be gotten that way. I do wish the examples would move beyond something we could paste into twitter.