Why (Some) Smart People Hate Programming
symbo1ics.com
symbo1ics.com
Lisp is basically a ghetto where it's every man for himself. You have all the tools to build the most wonderful abstractions ever, and many people do. The problem is that person A's abstractions don't play well with person B's. And that means where the other less-perfect languages have libraries that everyone can share, with Lisp, you're stuck with your own.
This is not a result of syntax flexibility, though, it's the result of attitude. Perl has pluggable syntax and nine billion different ways to do OO. And yet, all the syntax extensions are composible. An object created with Moose can be subclassed "by hand". It all works.
It's attitude, not tools. If you believe that you're the smartest person in the world and that only you see the light... well, it's going to be lonely. And programming is about 50% being smart and 50% not reinventing the wheel. The attitude of a "smug lisp weenie" immediately puts him 50% behind.
(BTW, I say this as a CL fanboi. I love the language. I can just never do anything fun with it, because I have to decipher ten different libraries for writing unit tests, none of which have all the features I need.)
Clojure, though, is a nice option.
Writing 'useful and compatible libraries' isn't fun?
I haven't really used Lisp beyond a few toy projects, but it seems, in this respect, to be similar to Javascript, which I do have quite a bit of experience with. The classic example in Javascript is inheritence. In his "Advanced Javascript" talks, Crockford lists three different patterns for inheritence, each of which is incompatible with the others. Furthermore, I know from experience that each of the techniques has some severe drawbacks - some (such as Crockford's "parasite inheritence") are incredibly wasteful of resources, keeping a copy of each function declared for the object with every instance. Others, such as "pseudoclassical inheritence" don't work if you want to inherit from a native object.
I use Javascript for my day job, but my favourite language is Ruby. And I can't help missing the fact that it is much easier to share code with other people in Ruby (largely because it does have defined mechanisms for code reuse) than it is in Javascript. I'll never get two objects in Ruby that can't be used the same way because their system of construction is different.
I appreciate that such flexibility helps with the expressiveness of the language, but when expressiveness comes with the price of not being able to easily work with others, I can't help wondering if the price is too high.
Consider Clojure for a nice, opinionated Lisp.
Well, actually you might if they monkeypatch some core class in incompatible ways.
new_number = Fixnum.new # FUUUUUUUUUU-
# Well, OK…
new_number = Integer.new # OK, seriously?
# Fine, then. Maybe some specialized classes are exceptions.
this_should_work_right = BasicObject.new
# Ah, it worked!
puts this_should_work_right # WTMFH?!?!?!?!
ClassA = Struct.new(:name, :age)
ClassB = Class.new {attr_accesor :name, age}
a = ClassA.new
b = ClassB.new
a[:name], a[:age] = 'Fred', 42
b[:name], b[:age] = 'Rick', 24 # Won't workLet's also not forget that Lisp was originally conceived as an alternative mathematical notation.
Even worse, using the same single letter and adding ` (prime) after it different numbers of times! WHY IS THIS ACCEPTABLE?
I understand a lot of it has to do with blackboards, but this does not apply in a teaching scenario! You do not need to worry about characters-per-minute on the blackboard until everyone in the room is a maths prostgrad. Don't inflict that shit on me and my fellow computational complexity students. Any minor ergonomic gains are offset by that fact that half the room has no fucking idea what is being written about.
edit: the WORST thing is when all the single-letter variable names are letters that RHYME. e, c, d, p, g. There are other letters dammit! We're not all on your end of the autistic spectrum! Have some consideration!
I think if DHH hadn't had the php constraint, he might have got lost trying to decide which church was true. After a few years of php he was able to forge ahead with a language that fit his ideals better.
I think if someone finds themselves similarly stuck it might be good to spend most of their programming time on something popular for a while.