Wednesday, November 16, 2011

Programming Languages to Learn

Many languages these days are fairly Lispy, except for being homoiconic and thus having a full-strength macro system instead of C's token pasting or many other languages' nothing.

But which ones are absolutely vital to learn, and which ones are "just different languages"?


Ruby

Ruby is an incredibly thoughtful language, and using it, you can't help but think about the decisions Matz made, and the ones you're making.  Coming to Ruby after having seen Perl, the inspiration is clear, but Ruby has been distilled.  You can probably make Perl do everything Ruby does, but in Perl you have to work for it.  In Ruby, it's frictionless.

Ruby also has regular expression syntax in the language.  This power will corrupt you, and you'll wish for it every time you need to run regular expressions in any other language (except Perl, which also has it).  But it's also worth it.

Clojure

It's just as thoughtful of a language as Ruby, but it's also on the JVM, and its Java integration is so good that it's a better Java than the Java language itself.

It's also a Lisp that isn't Common Lisp or Scheme.  This frees it from a lot of historical decisions, which makes the language much more focused on being a modern functional language.  It keeps all the benefits of Lisp, but also brings in immutability and leverages that for its concurrency models.  (Because you don't always want the same kind of concurrency.)

In short, Clojure should expand your mind just as much as any other Lisp, and then some, all without the archaic names and relatively poor suitability for modern work.  You don't need a well-stocked asdf to have a basic, portable environment set up.  Since Clojure is, at the moment, just one canonical implementation, you don't even have to worry that hard about portability, unless you want to write for ClojureScript.  (But for learning Clojure itself, you probably don't.)

C

I debated putting this one on the list, but I think it's still vital simply for the fact that it offers raw, unfettered pointers.  Once you grasp pointers vs. values, you have the foundation to understand pointers in any other language.  Though they won't be called pointers, since those got a bad rap for being "hard" because C crashes when you make a mistake.  Which you do a lot, when you're learning.

C style syntax also forms the basis of several other languages, and it's still a sort of lingua franca, though that role has been moving to Java.  (Which tells you something: Java is the least mind-bending language around, if it's believed to be easiest to understand for the most people.)


Beyond the Gate

There are probably other interesting languages to learn, but I would have a hard time calling any of them out as vital.  Clojure and Ruby pack a lot of attention to design in their languages, and that shows through in everyday programming.  At the same time, though, I feel like there's something deep that I'm missing about the Forth family.

Therefore, I don't think this post can be the definitive list for all time; it's incomplete because I haven't learned every language, and it's not a static list because languages and the practice of programming itself will change over time.  But for now, today, this is my list.

Go forth and program.

No comments: