Learning a new programming language can affect the way you think. While most modern languages are Turing Complete and can theoretically all accomplish the same things, that’s not practically true. Each language has its own strengths of expressiveness. For instance, trying to write dynamically typed code in C++ is possible, but a pain in the neck. You would have to implement your own type system to do so. Each language makes certain things easy and other things hard. Learning different languages then exposes you to different approaches. Each approach provides a different way of thinking and a set of tools supporting that way of thinking. What follows are some of the languages I’ve learned and what I think they provide. This list is limited to languages I’ve studied in at least a little depth. There are many more languages out there that may be useful. If you have additional suggestions, please make them in the comments.
- C – This is coding very close to the metal. Learning it promotes an understanding of memory, pointers, etc.
- Lisp/Scheme – Once you get past your parenthesis-phobia, it’s a very elegant language. The big learnings here are treating code as data, metaprogramming (writing programs that themselves write programs), and recursion. Lisp is also a dynamically-typed language.
- Clojure – A variant of Lisp that runs on the JVM. In addition to what you can learn from Lisp, it adds persistent data structures and transactional memory. Persistent data structures are ones that *never* change. Once you have a “pointer” to one, it will never change underneath you. This makes parallel programming much simpler. Clojure also is more of a functional language than Lisp/Scheme. It is not purely functional, but allows for the functional style to be followed more easily.
- Smalltalk – Much of modern programming originated in this language. Modern GUIs are based on the Xerox Parc Smalltalk systems. Object Oriented programming was first popularized in Smalltalk. Extreme Programming, Agile, and Design patterns all found their initial formulations in Smalltalk. In addition to learning about OO programming, Smalltalk is great to understand message passing. This gives object-oriented code a different feel than the function call semantics of C++/Java/C#. Smalltalk is also a dynamic language.
- Perl – Perl was once known as the duct tape of the internet. It ran everything. It has since been surpassed (at least in blogosphere popularity) by other scripting languages like Ruby and Python. The biggest thing to learn from Perl is regular expressions. They are built into the core of the language. Other languages support them but often as a library. Even those that do support them in the syntax do not usually utilize them so pervasively.
- C#/Java – These languages both solve the same problems in almost the same ways. They are a great place to learn object-oriented programming. It is built in from the ground up. The OO style is one of function calls and strong interfaces (which distinguishes it from Smalltalk). These languages also have the largest accompanying libraries.