Skip navigation

I often see many fellow software engineers learning new programming languages every now and then, in the hope that they are increasing their "marketability". They seem to think that the more programming languages they know, the better. C, C++, Java, Javascript, Python, Perl, Ruby, Groovy, Scala, C#… the list goes on and on. These chaps are the first to get swayed by PR of companies marketing these languages (Microsoft for C# and .NET being a prime example). Hell, I talk as if I have been a saint, no, even I used to be in this – "Run to learn the latest language" club.

But over time, I have figured out that learning a language is never accomplished without using it in and out, in all sorts of ways, in all complexities, in various projects. What’s the average length of a code example in a book? Roughly 100 lines. And what’s the average size of code bases? 1000s and 1000s of lines. Unless you use the language to create something, you are not using the language at all. After all, a programming language is just a means to an end. It’s a tool in your hand to create an application, a service, something concrete and tangible.

Having come over to the Java world 2.5 years back, I have this habit of looking back on the code that I had doled out when I was new, and compare it with the code that I churn today. I find such a huge difference. The code that I produced 2.5 years back, is down right laughable in some places. Being at Sun, I was able to work with some very very smart people and hone my skills as a programmer (there is still a huge scope for improvement, as my recent experiences in the NetBeans land have told me). The code reviews have taught me a lot and continue to. I have been fortunate enough to work with some real wizards of design and Java platform and I am always in awe of such people and their ability to assimilate complexity and I try always to study their approach to problem solving. It gives you lots of pearls of wisdom and improves you as a programmer.

Even after this, when I feel that I write much better code than I used to, there is still a long long way to go for me in the world of Java. I still don’t know the little things which one gets to know when he is aware of the Java Language Specification. I still haven’t really decompiled a Java class, and tried to understand the byte code. I still am baffled by the whole area of memory management. I haven’t ever done a performance analysis or improved performance of code written by a different programmer. Never used NIO, still need to go slow when dealing with multi threading…. the list goes on and on. As Bharath Ravikumar (my former colleague at N1 SPS development team) rightly pointed out when I discussed this with him, it’s a matter of spending time gathering these experiences. I should try and work on all sorts of things in Java, and when your day job cannot satisfy such a quest, it’s best to turn to open source to satisfy your creative hunger.

You can make out the difference between someone who has just learnt the language and someone who has made better use of the time to work on projects in that language.

Now some readers may say that knowing just Java is not good enough, some languages are much better suited for certain applications. I totally agree. But, knowing a low level language (C), a middle level language (Java) and a dynamic language thoroughly, should be good enough for most, if not all, applications.



  1. I dont think Java qualifies as a middle level language, not even compared to C. You still have to do a lot of repetitious boilerplate code.
    I think the only difference with Java simply is that compared to C, Java is not "efficient" enough (efficient in the sense that you don’t see something like a Linux Kernel written in Java, not about speed or coding time)
    But aside from this I totally agree about tying low level lang with high level lang – just not about "mid" level language.

  2. @She: Threading support for eg.? And yes, it’s still time before one can even think of writing a kernel in Java, but, I would want to ask, would you prefer to write a web application in C?
    Moral: Horses for courses.

  3. I like to learn new languages not to increase my marketability but just to learn new things. To really learn a language you need to adopt it’s coding styles which will teach you new ways to think about coding that you can then bring to your normal day to day work.
    One of these I will write something useful in LISP. Really.

  4. I’m one of those guys who runs to every new language available (and old ones… go Lisp!), but I certainly don’t do it for marketability. I do it for the exposure. Understanding Haskell and Scheme has helped immensly in getting a better handle on the creative ways one can mold functions and objects into solutions. Hell, just Haskell alone has helped me understand complexity and correctness analysis better than any language to date.
    I see your point, and you are absolutely correct. We’re a C shop here, and I’ve some fellows that understand the nitty gritty compiler, linker, and OS runtime internals better than I ever will, and the ways that knowledge pops up in solutions continues to surprize me.
    In other words, you’re right 😉 I think exposure to languages can do nothing but help one’s overall outlook and encourage it at every turn, but for the resume, know your core skillset inside and out.

  5. @Simon and Michael: Very interesting comments indeed. Yes, we all want to learn new things, don’t we? And gosh, the first time I saw closures being used in Groovy, I fell in love with the concept. I totally agree with you about learning new things and taking the learnings to do things better than we used to. As for Lisp, learning, and perhaps using Lisp, requires serious rewiring of my brain, which is very good :).

  6. Thanks for this insightful article!
    I’m a pretty young programmer and I often now lament my primarily academic experience in the field. I’m so excited about a book like Beautiful Code specifically because it does allow me to look over the shoulder of some of the greats and see how they think and do when they are faced with a problem.
    I’m about as guilty as possible when it comes to wanting to learn every language that comes around. Of course, not being terribly smart, I can’t learn most of them, but the desire is still there. I’m definitely going to take this advice to heart and try to stick to real tools like Object Design and Systems Analysis rather than mucking about in the latest and greatest dynamic language.
    Again, great tips!

  7. "(efficient in the sense that you don’t see something like a Linux Kernel written in Java, not about speed or coding time)"
    🙂 Sorry, I had to.

  8. When discussing the merits of diversifying or specializing, I think it’s important to distinguish between concepts that are specific to the language, and concepts that are more generally applicable.
    Multi-threaded code, for instance, is a general concept that is applicable across many different languages. You could learn about multi-threaded code whilst programming C++, and much of what you learn could be applied to Java.
    Likewise, JVM-based languages like Scala or Clojure can use Java libraries and classes. Knowledge you pick up about the Java standard library can probably be applied to other JVM-based languages.
    The only thing that is specific to Java is its syntax, and even then there’s a lot of overlap between C-style languages. So I suspect that diversifying is not necessarily the disaster you portray. A good knowledge of Scala will not degrade your knowledge of Java, and may even improve it.
    Further, all languages have limitations. If you focus on one language, there is a tendency to become blind to its faults. I’m not advocating that one should learn a new language every week; but I do think that people spend time exploring alternative languages. If you don’t, how would you know whether or not you’re missing out?

  9. Hm, I don’t much like these ideas, I’m afraid. I’m learning Haskell in my free time at the moment — I haven’t written 1000 lines of it yet, and I don’t expect to use it at work anytime soon, but that’s *not why I’m doing it*. Are you sure your fellow programmers are learning to increase their marketability, rather than because they want to figure out what’s the deal with (e.g.) this popular Ruby stuff?
    There’s nothing wrong with trying to improve yourself by spending your free time learning new ways of thinking about programming; most of the incredibly competent programmers I know do the same.
    – Chris.

  10. [Trackback] Bookmarked your post over at Blog!

  11. Sure, if you just *read* the book and never code anything in the language, then you’ll not really *know* it. However, that seems to me as the case for any skilled activity. You can’t read a book on carpentry and expect to be a carpenter without practice.
    The point of learning new languages is not just to learn their syntax, but to learn the features / styles / practices that language a supports that language b does not.

  12. @Chris: You don’t seem to get my point. I have nothing against learning a programming language to learn something new and perhaps better. I have learnt many languages just for that. I am against learning stuff to put it on your resume. All I say is : If you are learning a language, just don’t read a book and say that you know it; USE IT.
    Please see a comment above from Michael, who aptly summarizes this post.

  13. Reading about a topic never makes you a great programmer. Take for example, something as silly as learning how to cook. Yes, reading and watching someone else will give you an idea of what is possible, but until you get off the couch and do it for yourself, you can never expect to become a great chef.
    Also Java isn’t immune to being helped by marketing efforts so don’t knock it too much. In fact most of the reason there are other languages is because they fit a class of certain developers better for whatever reason.
    I didn’t choose any languages that I was/am an expert in solely because of marketing. LISP I choose because of AutoCad, C# because the company I work for.

  14. I think of folks who spend time learning all these different programming languages as practicing the "buck shot" method of career development. They are hoping that by having enough random skills they will be able to land a job of some kind. And that’s just due to uncertainty in the field right now.
    The real problem is it’s not just a matter of learning languages… it’s a matter of learning practices and paradigms. I’ve spent most of my career working with Linux so switching to Windows now would be hard even if I was working in familiar languages. I’ve spent most of my career working with web development now so changing back to desktop applications actually proves rather hard.
    I think that’s why Java the virtual machine drew a lot of us in initially… it promised that we could learn one set of practices and paradigms and work with cell phones or desktop programs or server side applications. Delivering on that promise has been a pretty rough road for Java. It turns out to be easy to get a quick "that’s cool" reaction from media but hard to make something that can really weather the storm of decades of real world use. … I’m certain that actually pulling off the same challenge is going to be rough for any company no matter how much "cool factor" they are endowed with.

  15. Here, Here. You are, of course, right. But as others had pointed out, a developer should never be content with only one language. I see this more often than not in .NET and Java, where developers believe this is the end all of programming languages ( well, at least for .NET developers until Microsoft convinces them otherwise with a new shinny framework/language , although .NET is probably here to stay for a while).
    We should be responsible and think not of ourselves, after all we made it to this blog so we care about the topic, but about the next generation of programmers. Ruby will probably not give us the next mozilla, latex or linux. It will almost certainly never give us the next Ruby.
    The advice you give of learning different level languages its a very good one, this is what we for should try to foster. The right language, for the right thought process. In what I disagree is about your number 3, we should learn as much as we can, after all programming should trancend languages, and their associated quirks. Hell, half of programming is about learning your way around quirks.
    Your lingua franca will come naturally, this is not something you really, really choose. Except your a Guido or Matsumoto… =)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: