My current programming language arsenal
August 11th, 2006 at 12:09 pmI firmly believe that a programmer must know several programming languages well in order to be top-notch. And the less similar these languages are, the better. The reason for this is that different languages often present different programming philosophies - different approaches for solution of problems. Being acquainted with several techniques to solve a single problem makes it easier to solve the problem in an optimal way.
Additionally, my philosophy in programming is that no single language / methodology is good for everything. Some languages are better than others to solve specific problems, and an experienced developer must know when to use “the best tool for the job”.
I am programming computers non-stop since late 1998. Below is a description of my current programming language “arsenal”. Namely, the languages I am most familiar with.
C / C++
C was the language I began programming in, and is still the language I know the best. The reason for this is C’s simplicity. It’s a small, easy language to learn and to master. For the vast majority of applications, however, C is too simple. C’s focus is on performance, and hence it lacks modern abstraction mechanisms, which makes C programming much more wordly and tedious than contemporary “high level” languages like Perl and Ruby.
C++ is its older brother and a much more complex and sophisticated language. C++ is a very difficult nut to crack, mostly because it combines complex abstraction mechanisms with terrific performance (if C is the measurement criterion set at 1.0, C++ has performance that’s rarely worse than 1.1). I know C++ quite well, but far from the total knowledge I have of C, for instance. In fact, I know only a handful of people who really know C++ perfectly. If you think you’re one of these people, try reading Alexandrescu’s “Modern C++” for a harsh return to reality.
These days I rarely use C / C++ for “desktop” coding. I still use C heavily for programming embedded devices, where it really is the only real option. But on PC’s (where code runs on top of full operating systems like MS Windows or Linux), C / C++ is simply inferior to other languages in terms of programmer productivity, which is a very important factor these days. Whatever I can write in C++ in a day I can write in Perl in a couple of hours. The only occasions I turn to C++ are when top performance or a low-level interface to the operating system or a third-party library are required. But even in these cases, the C++ part is usually encapsulated as a small library with the main Perl code controlling it using one of the many interfaces available. I had both linked C code to Perl for performance, and used a stand-alone C++ program connected to the main Perl script via a socket for accessing operating systems internals.
Perl
Perl is my main tool at the moment. Criticisms of Perl are numerous, and many of them are true, but whatever they say, Perl is a productive language. I know I can write good and useful code in Perl that accomplishes the tasks I have satisfactorily. Perl enjoys an enormous collection of ready libraries for any purpose - the CPAN, a very mature base of documentation and literature, and the best programmer community (by a mile) one can find (Perlmonks). However, Perl is getting old and some of the most advanced programming idioms take some teeth screeching to implement. OO in Perl 5 is a known fiasco (no matter how many Class::* modules they throw at you) and functional paradigms lose some of their charm because of the clunky syntax. While there is currently no language better than Perl to solve specific problems “at hand”, superior languages exist when it comes to writing big systems.
Ruby
Ruby is the best candidate to replace Perl as my “main tool” in the future. I just discovered it this year, and so far I’m charmed - and I try to write all my new “toy project” code in it. Ruby is everything Perl is and more. Language-wise, Ruby allows the same level of productivity and ease of programming as Perl, and adds a lot on top of it. Much cleaner syntax, an excellent OO system and even better tools for writing functional code. If there is a potential Perl-killer in the world, Ruby is it. Even Perl 6 won’t help here, because although it cleans Perl up and fixes some of its gravest deficiencies, I can’t fail noticing that it still looks inferior to Ruby 1.8 in many aspects, and Ruby 2.0 will be even better (and will arrive earlier than Perl 6). The best thing about Perl 6 is, IMHO, Parrot - from which Ruby will also benefit.
Ruby is not without problems, however, which is mostly why I still use Perl for most of my serious coding. The documentation is far worse, the community is much smaller and much less powerful, the libraries are incomplete and immature (and many have only Japanese docs and home-pages). The threads implementation is very weak and the GUI bindings are nowhere as polished out (Perl TK maybe isn’t the prettiest and the simplest library in the world, but you can create complex and useful GUIs with it, right out-of-the-box).
Ruby is also slow. Though compared with C++, Perl isn’t exactly the king of speed (it is on average an order of magnitude slower), Ruby is much slower than even Perl (x5 or so, according the the Shootout benchmarks and other sources). This isn’t a very big problem, because critical sections can still be written in C++ (for which Ruby has good bindings), but still I wish it could be faster, at least as fast as Perl, say.
Lisp
Lastly, I must mention Lisp, which is probably the most controversial language out there (it seems that people either love or hate it, without much in the middle). Although I don’t use Lisp for any real coding and unlikely to do so in the future, Lisp has taught me a lot. I feel that learning Lisp made me a much better programmer, and for that I will be forever grateful. As Eric Raymond famously noted:
LISP is worth learning for a different reason — the profound enlightenment experience you will have when you finally get it. That experience will make you a better programmer for the rest of your days, even if you never actually use LISP itself a lot.
What Lisp “teaches” is the functional programming style, which is IMHO the cleanest and the most elegant way to program.
Conclusion
Don’t stick to just one programming language, even if you like it a lot. Besides looking bad on a resume, knowing only one language will lock you in a very narrow point of view on the world of programming. Learning and knowing well at least 2-3 different languages is essential to become a much better developer.
Related posts:

August 11th, 2006 at 3:25 pm
For OOP Perl you might want to checkout Moose (it’s on CPAN). Makes the building of object oriented applications even faster. IIRC it’s designed after CLOS and the MOP idea.
August 11th, 2006 at 4:41 pm
I’m not sure your strategy works well for all programmers.
Here’s the point: Becoming a real guru in even one programming language is very hard, and its a process that takes /years/. If your language is in any way or form mainstream, keeping ‘up to date’ with changes between major releases is a further serious time investment. Even java is still going through a lot of changes that take a significant amount of time to adjust to.
So, what use does enlarging the toolbox give you? Well, for some things, a given language just has no business trying to be the right tool. If I’m going to write a device driver, I’m going to have to go with C. I might be able to sort of solve it if I know C++ or the appropriate assembler, but Ruby, Python, Java, Lisp… those are all a no go.
Similarly, if I want to write client-side web programs, there’s but one realistic solution, and that’s javascript.
However, for a very very large application domain, the actual languages that you can use is simply staggering. Take writing a web app. You can do this in ruby (RoR), python (Django, turbogears), java (struts, trails), etctera. C is a bit of an odd duck here but even that will work fine through basic of fast CGI if you must.
So, if you never go for large and complicated projects in those weird limited domains of client-side web and device drivers and the like, the sheer amount of work one needs to put in just to be a proper guru in that many languages, is it worth it compared to the limited gain in toolbox size?
These days, I’m thinking: For the vast majority of programmers out there, no. Truly grokking how to use a language is very difficult, and anyone who does know exactly which patterns work well and which do not, and has a thorough grasp of a whole flotilla of 3rd party tools for that language, and knows all key combos and quirks of a proper IDE for that language…
can beat or get close to the performance of someone writing in the language that is technically the best match for the task at hand.
I’ve been there I’ve parrotted the old ‘a programming language is a tool. Make sure you have plenty of tools, because if all you have is a hammer, you see every problem as a nail’ a thousand times. I know plenty of languages. But honestly, there’s currently only one that I consider myself ‘guru’ level at, and even if I *know* another language serves better, in the end I tend to do in a better job in my favourite language anyway.
Food for thought?
NB: In case it wasn’t clear yet, that old adage that a good programmer can pick up a new language in a span of weeks… that’s utter horse manure. Spending the better part of your waking hours of an entire year to 1 programming language MIGHT be enough. If you’re really good. And very experienced.
August 11th, 2006 at 6:06 pm
I agree with Reinier. Go take a look at:
They’re saying it takes about 10 years to become an “expert” in a field. How long does it realistically take to become an “expert” in a programming language? And what exactly does being an “expert” mean with regards to programming languages?
I’ve been doing sysadmin work for a few years now and am working on becoming a software engineer. One of my biggest struggles is deciding which languages to study in depth. I went to a talk last night about groovy and all I could think was I’ve been doing this with perl forever. The biggest thing I came away with was the maturity of Java. Java just celebrated its 10th anniversary. Will it be here in another 10 years? How long has perl been around?
My point is this, whatever languages you decide to study and master should either make you more efficient at whatever you’re doing now or improve your understanding of software in general so you’ll be a better programmer in the future.
August 12th, 2006 at 1:53 am
I support the idea that you should know a couple of very different languages, each specializing in its own thing. I do agree that it can take as long as ten years to become a zen master in any particular language. But, that doesn’t mean you can’t get things done in the language before that time span passes. My personal arsenal is:
C#: day job, windows forms (so far)
Ruby: scripting, manipulating files, quick prototyping
Scheme: Just general messing around, some quick prototyping
Haskell: I am learning this to get into the parallel programming state of mind. It’s my personal opinion that with multiple core processors, parallelizable code is going to become more and more important.
August 12th, 2006 at 7:22 am
It’s true that it takes time to master a programming language. However, once you’ve mastered one, I seems to me it will take far less time to master another, and I’m speaking from personal experience.
The point is, what takes most time to master is not the language itself but rather a correct, expert-level programming approach. This “approach” is unrelated to any specific language, but rather is a common set of mind tools that enable one to program well.
Once this mindset is mastered, learning another language isn’t difficult. I have noticed that one can learn a language reasonably well after coding one non-trivial project in it (several KLOCs +), but only if one is already an expert programmer, in the generic sense.
August 12th, 2006 at 11:04 am
If you’re only going to learn one “other” language, why not learn Oz?
http://www.info.ucl.ac.be/~pvr/book.html
In my opinion, it builds a strong foundation for understanding all of the various languages out there. It definitely makes it easier to pick up a new language in a span of weeks, since it’s just syntax.