Tuesday, July 13, 2010

Crazy person thinks ``Lisp sucks''

In this post, a person going by the initials CC declares:
There's a good reason almost no software has been written in lisp. Lisp sucks. Not just lisp, but the whole way the logic is arranged as nested things. The simplest problem becomes a mind-bending puzzle.
Instead of easy to understand:
if (a equals b) { 
  c = not d; 
} else { 
  c = d + b; 
}
You have this nested inner to outer logic where if is a function.
c = if(equals(a,b), not(d), plus(d,b)) 
The first is definitely more readible [sic] and it reads like we think of the logic. No one thinks of if as a function that takes three arguments, and forcing you to work that way just makes you crazy.
I suppose it is futile to argue with an admittedly crazy person, but perhaps being forced to work with conditionals has made me crazy as well. A closer translation of the original code would be this:
(if (equals a b)
    (setq c (not d))
    (setq c (+ d b)))
If these sorts of differences are a ``mind-bending puzzle'', perhaps the author should consider a career in the housekeeping or food-service industries.

2 comments:

  1. At least CC is up-front with a blog named "Crazy On Tap".

    It's natural for imperative-style programmers to feel and act a little bit crazy when confronted with a language where they try to shoe-horn their old habits into this new way of thinking. Of course Lisp will feel like a straight-jacket in that case!

    In my experience, the people who rant like CC tend to be people who don't even know their own language of choice very well.

    First, I assume that CC's language of choice is C or Java, but the example in the post uses "a equals b" which is not a valid expression in C nor Java. It is C-like enough that I'll just assume one of those.

    If CC were experienced in either of those languages then the first thing that should come to mind is this: ?:

    And now when we compare the C-like example written with a conditional expression versus Lisp we see they are not so different (ignoring the prefix notation for the moment):

    c = (a equals b) ? not d : d + b;

    (setq c (if (equals a b) (not d) (+ d b))

    I bet language designers just added conditional expressions to C merely as a whipping post for naive programmers afraid of thinking in different ways!

    ReplyDelete
  2. The comments are truly a comedy of errors.

    ReplyDelete