Language Dabbling Considered Wasteful
[Update: I have renamed this post. The original name, "New Languages Considered Harmful", was supposed to be a tongue-in-cheek way to get people thinking. I chose it playing off of the reference to Dijkstra later in the post. It's absurd when taken literally: every language was once "new", and what exactly should we stick with? ALGOL? Fortran? Analytical engine punch cards? Unfortunately it came across as incendiary, which was not my intention. This post is not about computer science education: I believe it's important for programmers to be exposed to a variety of languages and paradigms as part of their education. It is about how much professionals get from learning new languages. There are enormous productivity gains one gets from sticking with a small set of orthogonal languages; moreover, dabbling in languages is overrated as a way to get better at programming (in particular, when compared to reading high-quality source code). Plus there's a world of stuff to learn, some of which I think has better returns than a new language for most programmers. Examples of these "language sets" could be C/Ruby/LISP, C#/F#/JavaScript, C++/Python/Java, etc. The sets are not static, but in my experience there's seldom good reason for change. In my own personal set I've had two changes in the last 7 years: Ruby displaced Perl and JavaScript got added. The original article is below in all of its flame-inducing glory.]
Learning new programming languages is often a waste of time for professional programmers. It may be a fun waste of time (i.e., a hobby), but it’s a waste nonetheless. If you do it for pleasure, then great, but profit is scarce. Pointing this out among good programmers is heresy: even the pragmatic programmers, whose teachings are by and large excellent, suggest we should learn one new programming language every year. That’s rubbish.
The theory is that by learning a new language you "expand your mind" and become "a better programmer". Right. By that kind of argument we should all be eating LSD (don’t). In reality learning a new language is a gritty business in which most of the effort is spent on low-value tasks with poor return on time invested. You need to get to know the libraries, struggle with the environment, find or tune a text editor, look for tools, and so on. Most of the effort has to do with housekeeping chores, which are surely not mind-expanding by anyone’s measure. If you hope to be productive in the new language, things are even bleaker: proficiency has less to do with the language itself than with the myriad technologies you must master to use it effectively.
Even core language learning offers dubious return. How much does it really help to learn a new syntax? How does it expand your mind to learn new operator precedence quirks? Much of what constitutes a language is lexical and syntactical bureaucracy. Worse, you’re learning absolutely nothing about fundamental aspects of computer science. No algorithms, no operating systems, no compiler theory, no math, no AI. If you’re an undergrad, then you should have time to pick up languages on the side while learning all that, of course. But a professional is making a trade-off: what else could you learn with that time? We’re better off studying business, security, usability, architecture, software estimation, and so on, rather than spending time with a different language every year.
If your goal is better programming, you will learn far more from reading high-quality code bases in your current languages than from a new language. Go read top-notch code in the languages you know already; it’ll teach you techniques and style quickly, plus different ways of thinking about problems, with the added bonus that you can actually use what you learn. You can also understand a lot about programming languages in general (issues like typing, scoping, functional vs. imperative) by reading a good book.
There’s another pernicious effect to language hopping: it hurts your momentum. Every time you rely on your current languages you get a little better. Not in a fluffy expand-your-mind way, but in a concrete way. You learn more about your libraries, you set up a new macro in the editor, you have a chance to use that new language feature. Scott Hanselman argues that learning a new language is sharpening your saw, but I see it as neglecting your half-sharpened saw while playing with the dull, new, shiny one. The upfront cost is not the only one either. It’s better to have 3 razor-sharp saws than 8 so-so ones. Each new language you add to your toolbox is making it harder for you to become furiously productive in any given language.
Forget Ruby - Here’s Clipper!
Yet, any programmer worth their weight in silicon must know multiple languages. Sometimes the new saw is of a different type altogether, and it’s worth having. Right off the bat there are major obvious reasons. Different systems or parts of a system call for different languages; that’s been true in any environment I’ve ever worked in. For a while this was mostly due to speed and level of control. My first apps were written for MS-DOS in Clipper, which was a database-oriented rapid development language. Fast to develop, but no power. Soon enough we wanted to add features that called for C and assembly. Using C we could write terminate and stay resident (TSR) programs and spice up our apps with features no one else had. Sometimes the issue was not so much power, but speed. There have been many happy marriages to deal with this: Tcl and C, VB and C++, Perl and C, you name it. Fast processors and web apps have largely killed the speed/power motive. Computers can happily run applications written wholly in Python or Ruby. And if they can’t, a different language probably won’t help; you just need more web servers. But alas, you now need to know SQL and JavaScript too, so we’re back to obvious reasons for multiple languages.
Aside from the immediate reasons, there’s some merit to the mind expansion argument. I think being proficient in at least two languages is indeed important for boosting your ability as a developer. This resembles human language: learning a second one changes the way you think and your perception of the world. The third or fourth, not as much. But it can’t be any two languages. If you know Portuguese and Spanish, your mind didn’t have to expand much. Likewise, learning VB.net and C# doesn’t count. Also, I agree that some programming languages are hazardous to your skills if used exclusively. Edsger Dijkstra claimed COBOL crippled the mind and that its teaching should be regarded as criminal offense. We all know who’s the new COBOL. Java, the kingdom of nouns, is a programming straight jacket. I imagine Dijkstra would have called for harsh no-parole sentences for any CS Department chairs whose students learn only Java. If you write a lot of Java code, being fluent in a richer language does sharpen your saw. This is true for other statically typed languages, but to varying degrees. More on that in a bit.
Java protects developer from self
You might think this is contradictory. You’d be right. Life’s not simple; sorry, I wish it were. The realities are:
- Learning new languages is very expensive (in time), a huge opportunity cost
- There is loss associated with using multiple languages: the "jack of all trades, master of none" problem
- A good programmer uses multiple languages
But there’s a sane way to deal with these. Why, you just need to find the minimal language set. The smallest set of languages it takes to crank out great software quickly while growing as a programmer and making rivers of cash. In the next entry I’ll talk about my personal language set and the factors I used to compose it.
Switching to Touch Typing and/or Dvorak
I learned touch typing in October 2006, first on a regular keyboard layout and then on Dvorak. I’m posting the results for those who wonder about switching.
My situation was a common one for people who had computers as children. I typed at a decent speed (~50 WPM) but in a wholly chaotic way. While I didn’t fish for letters, I had to glance at the keyboard sometimes to "get my bearings". Some words were burned in finger memory: "printf", "protected virtual", "SELECT * FROM", "site:". You know, words that people commonly use. But I wanted to improve my typing for efficiency and ergonomic reasons (I wanted my monitors at the right eye level without the need for looking down at the keyboard).
Here are the results. Speed is in net words per minute (total words minus mistakes). The starting point was ~50 WPM, which was without touch typing and on a regular layout. Before touch typing my accuracy was much lower, so the net speed was well below the total speed. Touch typing is more accurate. That’s not shown in the numbers, but it does make you happier (in a control-your-environment sort of way). Also, my original ~50 WPM would drop lower depending on the typing task - being able to type without looking is a boon sometimes.
| Regular Touch Typing | Dvorak Touch Typing | |
| Hand comfort | Much worse than starting point | Almost as good as starting point |
| Speed after 2 days | 20-25 WPM | 15-20 WPM |
| Speed after 2 weeks | ~30 WPM | ~30 WPM |
| Speed after 2 months | Stopped. Decided to try Dvorak. | ~50 WPM |
| Current speed | - | 75-80 WPM |
I did some research about Dvorak at first but decided against it because the speed difference compared to the regular layout didn’t seem worth the hassle. So I bought Typing Master and learned regular touch typing. Using the software you can learn touch typing very fast, in a matter of hours. By "learn" I mean you’ll be able to type without looking, but you’ll be slower than the Filthy Critic’s cousin. It feels like you’re handicapped: you want to type but the fingers just won’t move. Avoid heated online discussions for the first two weeks.
After 2 weeks I was back up to about 30 WPM, but touch typing on the regular layout felt uncomfortable. I have decent finger mobility from playing the guitar, but the movements still felt ungodly. I decided to switch to Dvorak instead.
Support for Dvorak is excellent in Windows and Linux. I changed system settings to Dvorak and kept the same keyboard. I actually like the fact that the keys on the keyboard have the wrong labels: it makes you stop looking in no time. Typing Master is geared towards the regular layout, but it does Dvorak well enough. I would look for specific Dvorak typing software though. The move was pretty painless; the major issue was typing passwords. Sometimes I had to use a conversion diagram (link below) to type a password, since I couldn’t see what I was typing nor look at the keyboard to know which key to press. Also, people have a hard time using my computers now :). That can be a bug or a feature. I don’t think you should expect a speed boost from Dvorak, but it feels a lot easier on the hands than regular touch typing. I was surprised to find out that, at least for my hands, "chaotic" typing is the most comfortable method. I was also surprised that typing on Dvorak did not help me impress women.
Based on my experience, I suggest this:
- If you don’t touch type and want a speed boost, move to Dvorak
- If you touch type on regular and have hand problems, move to Dvorak
Otherwise, don’t bother. Links:
- This diagram (prints better than it looks) and this one helped a lot. They are crucial for the first few days, and for passwords in the first couple of weeks.
- I really liked Typing Master (no affiliation), but there are free alternatives out there