Thursday, January 6, 2011

Curing PL Anxiety

Some years ago I was in a state that I now discover in many other people on the web, and which I term "PL anxiety". It is characterized by a constant insecurity about which PL is the best, which one to learn, how "fast" each one is, whether PG is really right, etc etc.

In retrospective, my way out of this was a four-pronged approach:

(1) The Breadwinner PL

You should know one language that's reasonably popular where you live, and which will always land you a job. In the past that meant C++, C, Java, C#, and maybe Perl and PHP, but these days you can probably also get away with Python, Ruby, JavaScript, or Scala.

What's important about the breadwinner PL is that you know its semantics and its standard library by heart.

(2) The C PL

Infinitely many good things come to you by learning C, because your OS is written in it. Studying C, you'll learn awesome stuff, like how to handle SIGSEGV, exploit your branch predictor, write a language runtime, and what a linker is, for example.

The more you learn about C, the more you'll learn about a wide array of services that are already provided to you by your OS and compiler. And C is fun and simple to boot, and will give you the warm fuzzy feeling that comes from building things (almost) from the ground up.

(3) The Romantic PLs

These are languages that you really like and if you're really lucky, might one day get paid for using. You don't have to make a choice - learn them all. They all have their pros and cons, and in the end you'll have to roll your own, anyhow.

(4) The Other Interesting PLs Out There

Also keep an eye on olden golden PLs and newcomers to the scene, even if you're never going to use them: they may blow your mind, and that's what you really should be looking for. Ωmega is a good example.

The Real World

I've come to start new non-hobby projects in my breadwinner language, because it's the most convenient, I know it by heart, all my problems have already been encountered and hopefully solved by somebody else, there are tons of libraries, and PLs seem to matter very little for many projects (and if they matter, you can always Greenspun it).


The thing that keeps me motivated learning more about PLs are PLs themselves. I learned C writing Lisp->C compilers, for example. I'm learning about dependent types because I'd like to implement a PL that has them. It's weird, but works for me.



gavin said...

You know this would be an even more awesome universe if your breadwinner was PHP.

Manuel Simoni said...

Hm... how so?

lifeh2o said...

I am a beginner and new languages other then my breadwinner seem like an unknown ghost.
I started some hobby projects with some ghosts but the disappeared leaving them unfinished.
Should i concentrate on breadwinner for now until i become an expert? or keep trying others as well?

Noble Bell said...

Very interesting post. I have been struggling with this myself.

My breadwinner is of course C#. Then I would have to say I like Objective-C and Cocoa on the Mac along with Java and BASIC.

Manuel Simoni said...

There are no hard and fast rules, but I think that as a beginner, concentrating on one language may be good.

Once you know one language very well, you'll be able to learn other languages much more quickly.

AlexCerati said...

I've been wondering about this for a long while. I've got my romantic language and lvoe it. I kind of get fed up with my breadwinners, but I know I have to stick with them.

Reverend Jim said...

I think there are two hurdles. The first is learning to program. The second is learning to program in a second language. There is a strong tendency to code in the style of the first language. As a marker for my former APL professor I found this to be especially obvious as the tendency was for the students (at first) to code in FORTRAN type constructs (loops, etc). Not coincidentally, the same holds true for spoken languages. Learning a third (or fourth) spoken language is significantly easier than learning a second.

BiGYaN said...

First of all great post.

I liked your comment on C. Personally I agree with the fact that understanding C is very helpful in understanding the very basics of how a computer works.

I have a question about what you call "breadwinner". I am a masters student, who would be jumping to a real world job soon. For most of my time, I have coded with C/C++. These days I use Java too. What according to you the value of C as a bread-winner language?

Prabhat said...

Nice post.

Nice to have it summarized (and categorized) so well. Amusing to realize that my own anxiety was not so uncommon at all.