Advantages Of Being A Polyglot Programmer

37 commentsWritten on August 15th, 2011 by
Categories: Opinions

For the majority of my career, i considered myself a C# developer because that was pretty much the only language i used. I learned other languages when i was in school, but i wasn't using them anymore. If i wanted to code something, i'd do it in C# because that was the language i was most comfortable in. Then last year, i started learning Ruby. This year, it's JavaScript (both client-side and server-side). Next year, i'd like to learn a real functional language, most likely Haskell. I still do C# at work, but i no longer consider myself a C# developer. These days, i consider myself to be a polyglot programmer. I feel quite comfortable writing code in 3 languages, and am looking forward to add more languages to the mix over the next couple of years.

I used to think it was more interesting to focus on one platform/language and really strive to know it thoroughly, but i couldn't disagree more with that nowadays. I've noticed that there are quite a few advantages to learning new languages and exposing yourself to new communities, approaches and ideas. And i believe they far outweigh the benefits of sticking to just one platform/language. There are 5 advantages in particular that i'd like to discuss in more detail.

It expands your horizons

There's more to becoming productive with a new language than merely learning the syntax of the language. You're going to learn about new tricks, new libraries and new ways of solving problems that are common in the community of whatever it is that you're learning. You're basically trying to soak up knowledge that is common to others, but new to you. Depending on what you already know, there might be a lot of new stuff to learn or it might just be small tidbits here and there. If you already know a dynamic class-based language, learning another one might not expose you to a lot of new stuff. But if you're used to static class-based languages, learning a dynamic class-based language is going to be quite an interesting experience. Try to mix paradigms to get the most out of this. It'll start to influence the way you think about problems and how you can solve them.

It makes it easier to learn new things

Practice makes perfect, right? If you're routinely trying to learn new things, the very act of learning new things actually becomes easier. A lot of people have problems learning things that conflict or contradict with what they already know. The first time you learn a new language based on a paradigm that you don't quite understand yet, it might take a while to grasp it because you're likely having difficulties thinking about things outside of the structure and rules that you're used to. It'll be easier the second time, because you're already more comfortable with letting go of what you already know and not restricting the way you think about things or try to comprehend them. And it'll keep on getting easier and easier. This obviously applies to more than just programming languages.

It continuously refreshes your love of programming

This one probably depends from person to person, but when i was still just a C# developer i routinely got into stretches of time where i didn't really have fun writing code. During those stretches, writing code was just a job, and no longer something that i once considered a joy and a hobby. Those stretches could last a couple of weeks, sometimes even a month or two. Since i started learning more languages, i haven't really hit a stretch like that anymore. It remains fun, interesting and challenging because you just keep on learning new things and you keep on improving continuously.

It decreases your reliance on certain tools and introduces you to new ones

2 years ago, i couldn't imagine writing code without a strong IDE to back me up. I was so dependent on Visual Studio's (and Resharper's) Intellisense, code completion, code navigation and strong debugging features that i just couldn't believe i could be as productive without those things. Nowadays, i really just prefer to code in a strong text-editor (TextMate was my favorite, but i recently switched to Sublime Text 2) with a terminal window to run my tests. I avoid debuggers by working in small steps, with small, focused tests which also make it (relatively) easy to isolate bugs and fix them. I actually don't mind 'poor man's debugging' (putting log statements in certain parts of your code to find out where things go wrong) anymore because i'm starting to think it can often be quicker than relying on your IDE's debugger. I recently even joked that they call it poor man's debugging because it's used by people who can't afford to waste time waiting for an IDE and its debugger ;) . Another benefit is that you'll have to get comfortable with the command line and perhaps even different operating systems. If you want to get into Ruby or Node, you're better off installing a Linux distro (or run on OS X if you happen to have a Mac) and experiment with the language/platform on that instead of trying to get things working on Windows. Getting comfortable with a *NIX shell and its tools is something that you're probably going to be able to use for a long time to come so there's no reason to shy away from it.

It makes you less emotionally attached to a language/platform

People who only work with one language/platform often have an emotional attachment to it. If you're emotionally attached, it's not always easy to remain rational during discussions or when the future of your language/platform is being threatened. If you know more than one language/platform, you know that your skills are transferable. You know that you can be a good developer no matter what you have to work with. You know that you really don't have anything to fear about how things will evolve. You just know that you can deal with it. Easily even.

  • Guest

    Agree 100%. However, here is the bottom line (at least for most people over 30) if you are supporting a family you may want to present yourself as a C# or Java dev, even if you are a polygot. Landing that big gig at often requires that you present yourself as an expert in at least one language, and often that language is not Ruby or a cutting edge technology like Node. That stuff is just icing in many cases. Assuming you go the enterprise route of course…

    In terms of maintaining interest and being a great programmer – polygot all the way.

    • Guest

      ouch, sorry about the formatting…..

  • http://twitter.com/dagda1 dagda1

    I still can’t find a better paying gig than C# so for the moment that is where I remain.  I would love to jump ship but not because I think there is a better platform but for no other reason than I would love a change.  Kids and mortgages make this decision unlikely for now.
    That said, You can still use a lot of the cool toys in C#.  I use git, sass, backbone, jquery and cofeescript and there is a lot of other javascript love out there at them moment.  This keeps things fun and motivating for me. I find myself more times just returning JSON from ASP.NET MVC controller actions and pushing more onto the client.
    This helps cures my rails envy.  I have a side project in JRuby also that is a welcome break from C#.

  • http://www.webpirates.nl Robin van der Knaap

    I think when you’re just starting out as a developer you should stick with one platform for a couple of years (2 or 3, maybe more). Not only do you need to learn the language, you also have to learn best practices, design patterns, good architecture and things like tdd, ddd, etc… 
    On top of that, you need to learn to deal with deadlines, changing requirements, making trade-offs, communicating with managers or clients and a lot of other stuff related to software developing.When you’re starting to feel comfortable creating software on your platform of choice, it’s time to go all polyglot and grow from a good to a great developer.

  • const

    I know exactly what you mean.  Thanks for writing it down so well.

  • Neale Forrest

    Very interesting points.  I have been a c# developer for about 6 years now and i feel that i am quite senior.  But as you mentioned, coding has just not become fun any more   
    I have been thinking for quite a while now on how i would like to learn a new language. 
    Your post has put me in the right direction

  • http://twitter.com/carlosqt Carlos Quintanilla

    Polyglot Programming FTW!

    I do agree with your post. Now a days programming languages are really getting attention, specially if they run over a runtime (CLR .NET or the JVM Java) this is really cool because you don’t need to learn new frameworks or libraries, but just different languages. To me that’s the part I like the most I find cool how your code looks so nice just by changing the syntax.

    I’m learning several languages at the time… not at the speed I would like since I have not much free time as before, but still I keep a track on those. You can have a look at my blog for a glance on ~20 active and useful languages running on .NET and JVM such as: C#, VB.NET, C++/CLI, F#, JScript.NET, Boo, Cobra, Phalanger, Nemerle, Delphi Prism, Zonnon, IronPython, IronRuby, Java, Scala, Groovy, Jython, JRuby, Fantom, Gosu

    http://carlosqt.blogspot.com/

    Regards!

    • Simon Hawkin

      Uh… not Clojure?

      • http://twitter.com/carlosqt Carlos Quintanilla

        Is in my wish list… and included on the Languages Page http://carlosqt.blogspot.com/p/programming-languages.html  

  • Vishalsodani

    “It decreases your reliance on certain tools and introduces you to new ones” I agree with this one completely.Since, working in pythondjango, I have not used IDE at all. And, it feels so liberating!

  • http://www.taylankaraoglu.com Taylan

    I agree with some of the advantages, but also it has a disadvantage of make it harder to known a language with all possibilities, and sure experience come with advantage of quicker programming on it. Some languages really like ocean. If you enhance yourself in one language and i mean REALLY enhance. It also has great advantage. (PS: Also i know and using c, delphi, c++, python, php, javascript and lots of language which i don’t use anymore)

  • Dennis
  • Silvio Amaral

    Great post, thanks. Can you share some light on how to effectively transition from heavy IDE dependent programmer to a text editor one ?

    • http://davybrion.com Davy Brion

      not sure if i have any good advice on that… i guess it’s just a matter of getting used to it, and making use of the tools at your disposal.  For finding things in code, i used to rely mostly on static analysis features of tools like Resharper, but you’d be surprised to see how far you can get with relatively simple ‘Find In Files’ searches… Obviously, that doesn’t offer all of the navigational features that static analysis based tools offer but you’ll get better at it over time, simply because you have to.

      For debugging: work in small steps and make sure that focused tests are an integral part of your workflow. And if you have to figure out why something isn’t working: look at the code and actually think about what might be going wrong.  A lot of people are too quick to resort to a breakpoint and start stepping through the code. While that certainly has its uses, it can easily take up way too much time as well if you’re just guessing and trying to stumble upon a repro.

      As for code completion or api docs: i don’t feel like i need code completion in dynamic languages, which is weird because whenever i try to do C# without IntelliSense, i quickly get frustrated and often just resort back to Visual Studio.  I often just have a browser window open with API docs, or in many cases (certainly in my node.js experiments): the source code of the libraries/frameworks i’m using.

      The most important thing though is to get used to thinking about new ways of dealing with things that you’ve always taken for granted because of IDE assistence… you’d be surprised at what you come up with.

  • http://www.lukegerhardt.com/ Luke G.

    Nice post.  I really appreciated the part about ‘emotional attachment.’  I’ve worked with single-language developers, and it was amazing to see the ardor they exuded towards me if I even hinted at suggesting that a project not be written in their one language or schema.  They even refused to learn anything new unless they were embarrassed into it. 

    I’m proud to be a polyglot!  :)

  • http://www.facebook.com/people/Johann-du-Preez/664614957 Johann du Preez

    “Empty your mind, be formless,
    shapeless – like water. Now you put water into a cup, it becomes the
    cup, you put water into a bottle, it becomes the bottle, you put it in a
    teapot, it becomes the teapot. Now water can flow or it can crash. Be
    water, my friend.”

  • http://profiles.google.com/tuseroni austin hamman

    pretty much what i have been saying for years. learn all manner of languages, but i think you left out a key paradigm:assembly. learn to write assembly and learn to write embedded programs these will help teach you how to write efficient code it will also teach you more about what the computer is doing at the lowest level.
    personally i started with qbasic at ~10, then i learned mirc script, then i learned c++ then i learned c, php, javascript, bash, im learning python and assembly right now and will be learning to program on the arduino when i get around to buying one…constantly i find myself going deeper and deeper into inner workings of the computer, learning sockets was a big aha moment. when i realized i could open a socket to a website, and pass messages from my browser to the website and became acquainted with http i felt there was little i couldnt accomplish on the internet. it was very liberating. and this translated well into my work, so when we wanted to do html reporting in our software and needed to use the xmlhttp object (which doesnt work with the file:// protocol) i wrote a small web server, because small web servers are REALLY easy to write…i had no idea until i learned sockets.
    when i learned to write kernel modules i had another aha moment, when i learned i could take input from a device and use that to drive the keyboard or mouse it felt like another large vista had opened for me, this is also when the idea of MAKING hardware came to me, to control the hardware AND the software AND the OS…its amazing. like the possibilities are endless.

  • Anonymous

    yep… c, c++, ada, python, java c#, even matlab… polyglot… had to look that one up… haha

  • Flavio Oliveira

    In my country, developers are attached to a language or technology, you just can find job tiltes like, C# Developer, J2EE specialist, C++ programmer etc .. Personally,  I do not agree with this approach at all.  I think such job titles only make the amazing thing of being a developer just less intersting, taking off all the magic of learning new stuff and put youtr creativity to work. And you only can find a bunch of dumb managers and monkey coders in this field here. 

  • Xavier Morera

    100% agree. I consider myself also a C# developer (shamelessly I can say I was VB.Net at the beginning – but focused on migrations from VB6 and also plenty of ASP.Net). Now I am working on IPhone dev, still learning, but still working on it.

  • http://crisdelvallelife.blogspot.com/ CoreAn_Crack3rZ

    Great Article! I agree with you on this. Having fun while programming is a lot more important to me. 

  • http://twitter.com/Merennulli Merennulli

    I don’t think you can really get away with being a single-language programmer anymore and still be a professional. I’ve worked “in C#” for the past 5+ years, but in reality, that means I’ve used C# to write core applications, maintained VB6/VB.Net apps, written T-SQL (extensively), written Javascript, etc. As a general rule, a professional also has to be familiar with what’s coming next, so at home I’ve played with numerous languages, and I tend not to code at home in the same core language I code at work.

    Of course, with Javascript now bleeding into all areas of development, that may change. I worry, though, that we’ll just get a bunch of abstraction above Javascript and make all future code be bloat upon bloat.

  • Rjdegraff

    Excellent post. My first programming language was Waterloo FORTRAN (back in 1971 as a first year university student). Learning a second language (PL/1) was difficult as my mind was “stuck” in FORTRAN. However, once I took the blue pill (learned to think in PL/1), I found it much easier to learn other languages such as COBOL (yuck), SNOBOL, Lisp and APL (still my favourite for Q&D prototyping for personal use). Since university I have programmed in various flavours of assembler, C, C++, vbScript, VB, ReXX, paradox and dabbled in Python.

    The danger in learning a new language is lack of control. I worked with 7-8 other programmers on large systems. However, except for the mainframe where the only languages available were FORTRAN and assembler, the programmers were pretty much free to choose their platform. This led to the situation where only one member of the group was able to support a particular piece of software. Also, other groups within our organization also developed software that our users were required to use. Because of this uncontrolled environment, I was required to learn Paradox and ReXX. We never did learn PowerBuilder because we didn’t have it in our budget to purchase the package.

    So learning and using a new language, from an education and personal development point of view is good, but in a production and maintenance environment it should be tightly controlled.

  • Mike Angelastro

    Baloney!

  • Univega_r304

    Interesting post. Though being a jack of all trades master at none is not alays a good thing. It’s best to be an expert in one area before spreading yourself thin… IMHO

  • http://pulse.yahoo.com/_UTBDDIRKT22L4GDWLHTQSTKBEI Dan

    I kind of don’t think you’re a real programmer until you learn assembly language: you must write something at the machine level in order to grok what the machiine really is and what it’s really doing, under the pretence and wrappers of other people’s ideas of what programming is supposed to be about. You should also learn FORTH, just because you should, because there’s nothing else like it, and it makes your brain work in all sorts of very “special” ways… some of which are bad, but a lot of which are very much consciousness-expanding. For pure structured programming, learn Algol-60: it’s a beautiful language, and in its own way, perfect: it’s also part of our history – the roots of block-structured programming and modern syntax parsing… not only that, but it gives you a window into the mind of Edsger Dijkstra, its creator and in some ways the father of us all.

    It’s also instructive to write your own compiler at some point: think up a language and write the compiler for it. It doesn’t really matter what it compiles into (for example, I have one which lets me define tables and relationships really simply, and then compiles into T-SQL which creates those structures on a SQL Server, along with triggers, indexes, stored procedures and so on which provide a business logic framework). In any event, once you’ve written a language or two, learning other people’s languages becomes easier: you start to realise what the compiler wants and to understand more of the mindset behind creating the language in the first place.

    • Kilfour

      I disagree wholeheartedly, and yes I have written assembler.
      A long time ago though, and mostly for motorola’s RISC processor, which was a really nice chip, btw.
      Intel’s one and all that interupt stuff adds nothing to the mind of a programmer, it’s all about getting around difficulties, not about solving problems.

      So yeah I do know how registries and all that work, but I can’t say it helps me much these days.That said, knowing the difference between stack and heap _is_ helpfull when doing c#, but I blame c# for that really, which still is just a wrapper around C.

      Stuff like Forth and especially Algol-60 is indeed part of our history (although SIMULA, imho, was far more important, but as you probably know, it evolved from Algol-60, so …)

      Is it really necessary to understand SmallTalk in order to be a decent Ruby programmer ? 
      I think not. 

      And when someone says good ol’ Edgar is my father I immediately develop an Oedipus complex, but that’s probably just personal bias.

      Writing compilers and such is easiest done these days, I find, in (very) high level languages such as OCaml or Haskell, which are really up for the task, and I get the same performance that I used the get from Lex & Yacc without all the low level stuff.

      It is a fallacy to think that one person can understand all of everything. 

      You have to rely on people before you being right and just take some stuff for granted, otherwise you spend too much time reproducing the same thing over and over, and never get ’round to adding anything new of value.

      Point being, history is important. But you don’t have to know the inner details of all that came before in order to appreciate it’s value.

      • http://pulse.yahoo.com/_UTBDDIRKT22L4GDWLHTQSTKBEI Dan

        Ummm… if you think C# is a wrapper around C, I think you might need to go back to Assembler again… C# is predicated on an entirely different set of concepts and compiles completely differently…

        You’re correct in that writing compilers is best done in a high-level language… but the compiler must generate low-level code, and it’s in optimizing the compiler to generate that code that understanding how low-level languages work has its benefits. This is especially true when you’re writing a “normal” compiler, which compiles down to machine code.

        Learning machine code adds everything to the mind of a programmer: the very fact that one has to get around all the interrupt stuff and limitations of registers and so forth is instructive in terms of understanding how the object code your compiler generates is going to have to do something similar: one can then adjust what one does to fit how the machine works. For example, a recursive solution to certain problems, while elegant in terms of the high-level language one writes, can easily create a serious drain on resources at the machine-code level, and it’s important to be able to understand what the machine is going to be doing as a result of your brilliance before deciding whether a recursive solution beats an iterative one, and so on.

        In other words, knowledge of how machine-code-level stuff works is of inestimable value in terms of understanding how to write efficient high-level code: programmers who do not understand this are similar to people trying to drift cars without understanding anything about physics: that they might survive is due more to luck than judgement.

        • Kilfour

          ‘I think you might need to go back to Assembler again…’

          I’ll try not to take that personally ;-) .

          I’m well aware that C# and C are _meant_ to be different. 

          I just feel they didn’t do a good job of it.

          Lot’s of Win SDK stuff leaks through and I really don’t see the advantage of having a WindProc in C# f.i.

          C# feels too close to the machine for my liking, as does C.

          I think a good language/compiler should abstract the way the machine works so that the developer can focus on ‘elegant’ solutions.

          Otherwise what’s the point of a higher level language in the first place ?

          I’m sure, since you’ve written compilers yourself, you’re aware of how one can employ certain tricks, in order to obtain this goal.

          A long time ago declaring a non changing variable inside a loop caused a memory assignment every time.

          Fortunately, we don’t have to worry about this anymore these days. 

          The compiler rewrites your code so that is declared and assigned only once.

          Over the years they have gotten smarter. 

          Especially recursion is no longer the problem it used to be.

          Tail call recursion can easily be transformed into a loop, and some compilers are even clever enough to transform any recursive call into a tail call one at machine code level.

          Most functional languages rely on recursion in order to get anything done, and a lot of them outperform imperative languages these days. 

          But mostly I believe in using a profiler for optimization, instead of wasting my time upfront, and then be proven wrong afterwards.

          In other words, knowledge of how machine-code-level stuff works is of inestimable value when you are writing a compiler.

          But this knowledge goes far beyond what used to be needed, and often requires knowledge only available to the chips manufacturer. 

          Which is one of the reasons I don’t write industrial strength compilers ;-) .

          This knowledge however is, imho, not necessary for writing ordinary programs.

          I’d rather parse my csv’s (using recursive functions) like this (taken from the real world haskell book) :

          import Text.ParserCombinators.Parsec

          csvFile = endBy line eol

          line = sepBy cell (char ‘,’)

          cell = many (noneOf “,n”)

          eol = char ‘n’

          parseCSV :: String -> Either ParseError [[String]]

          parseCSV input = parse csvFile “(unknown)” input

          Than get into the nitty gritty details of things, with only a minimal performance gain.

  • Pingback: links for 2011-08-25 | Michael Ong | On9 Systems

  • Pingback: Всем сотрудникам отдела! «

  • Pingback: Links for August 24th through August 27th — Vinny Carpenter's blog

  • Fadedreamz

    I think there is a problem to learning too much language. While solving a problem we rely on various library (why reinvent wheel ?). If you learn too much language then you will have to keep practicing with them, because without so you will slowly forgot the wheels. Now tell me what good will it do if you know the language but do not know the right wheel to drive it?
    Again conversely sticking to a single language will make you think every problem in the way the language work.
    I think there should be some concise choice of language should be made to learn. For e,g – C, C++, assembly for FW dev, ASP.NET, C#, jQuery for web.
    But above all we need to clearly understand the underlying architecture of the domain in which we work. I think that is the most important thing.

  • Kenneth Kasajian

    I can’t imagine only knowing one computer language.

  • silent sojourner

    It’s hard to learn a new language, if it’s Prolog or Erlang.

  • Denis Lutz

    Awesome article, thx, I work on very similar topics and completely agree with things that you say. Check out my blog if interested: http://producloment.blogspot.com/

  • http://twitter.com/rstackhouse Robert Stackhouse

    I’ve been reading “The Passionate Programmer” (albeit very slowly). One piece of advice the author offers is to have both broad and deep experience. Deep in one particular language/framework (i.e. C# & .NET). Broad in many.

    In my experience, as can be inferred from your post about IDEs, most developers don’t even bother to get deep experience in one language/framework let alone learn many. The multitude of avenues from which people arrive at software development as a career probably doesn’t help much here.

    I think we need to help pique the natural curiosity of our contemporaries to get them thinking about “How does that work?” or “How does that happen?” Understanding is still fundamental to good programming. Understanding however takes time to arrive at. Time that many companies/people don’t think they can afford. This is of course short-sighted.