Being a polyglot programmer

Many programmers learn one platform, one language and stay in their monoculture. Learning many different programming languages can definitely change your programming style and the way you think about problems. It was certainly beneficial for me, here is why.

After learning Pascal, C in the first semester at the University I started be commercial programming career as a PHP developer (part time in the second semester).  It was easy to start with and in demand so finding a part time job was easy. I never liked the language, it was not “pure”, I especially hated the function naming and parameters orders inconsistencies.

At the university I learned OOP principles and C++ and thought OOP was the answer to everything so I immediately changed my PHP programming style to incorporate it. My code became more readable and organized.  Later at the university I had to learn nonprocedural Prolog and functional Haskell. I found it very difficult because I had to think in another way and came out of my comfort zone. When I finished the course I really liked Haskell and functional programming because of its clarity, readability and the fact that I could write a very compact code. But I had no practical use for it. It did not change my Programming style but made me look for a more pure and “nicer” language to learn.

I found .NET and C# and was amazed by the tools for ASP.NET. Comparing to PHP creating websites in ASP.NET was easier, the programming language was more comfortable. I let PHP go and found a part time job as a .NET developer. Instead of ASP.NET I was hired for I programmed a Windows Mobile app in .NET Compact Framework. It was a great experience, I discovered threads and asynchronous programming. I took a C# course at the university and then worked a few months as a part time ASP.NET developer and discovered LINQ. LINQ was great and is one of the best (if not the best) features of .NET, it makes you write compact and clear code and lets you to an extent think functional (ideal for me as a Haskell fan). I began using LINQ extensively, my code and my programming style improved a lot.

I quickly got fed up with web development in ASP.NET, because it was not very challenging coding. I wanted to learn something new and do something more challenging. I found a part time job at Siemens that was partly analytical and partly programming and came to contact with Java. The only experience I had with Java before that was programming J2ME apps for my Siemens phone (strange coincidence).  Java felt strange, too much object oriented, no functional elements and without LINQ I felt like I was back in the stone age. But thanks to Java I discovered NoSQL databases, especially MongoDB. NoSQL databases changed my thinking about storing data, it was a great shift. They are a great fit for many project, you just need to realize that not everything must be force into a solid structure.

Quite recently I discovered F# and I was really thrilled. It let me program completely functional and at the same time interoperate with all the existing .NET code and libraries. It changed my programming style once again to be more functional and expressing. I try to do as much coding as possible in F# but is a real shame that Microsoft does not push it and it is still not equal to C#.

At the moment I am exploring Scala and Python through online courses at Coursera and in the future I may take a look at Erlang. I strongly encourage you do the same, learn as many languages and as many programming paradigms as you can, it will widen your horizons and make you a better programmer. You do not even need to use these languages every day, your programming style will improve independently on the language you program.

Update: After some experiments with Scala I think it is a really ugly language, compared to say Haskell. I took a look at SML, Racker and Ruby and I quite liked all of them.

  • Pingback: Being a polyglot programmer | My Daily Feeds

  • clojurian

    I suggest you look into Clojure after learning Scala and Python ( Just like Scala it runs on the JVM and on .NET and some more plattforms. It’s a very nice modern Lisp language.

    • Scalrian

      Who doesn’t know clojure?

      You aware that there is hardly a job available for clojure.

  • keithb

    I definitely agree with your suggestion, but I disagree about ASP.NET being “not challenging”. ASP.NET is just one branch on the .NET stack. If you couple it with other branches like WCF, you can find some really fun and interesting puzzles. For example, I built factory extensions for my RESTful service classes. Not something you see very often, but the challenging bits are rarely popular.

    • Igor Kulman

      I need to clarify that by ASP.NET I meant WebForms and MVC 1

  • Fadi (itoctopus)

    Hi Igor,

    Did they really teach you Prolog at school?

    I personally think schools should only teach 3 languages:

    - Pascal (because it’s a sweet introduction to programming)
    - C/C++ (because everything is built around them)
    - LISP (because it’s a very versatile language and is similar to many prominent languages)

    • Igor Kulman

      Yes, we had a subject called Nonprocedural programming where Prolog and Haskel were taught

  • Stephen Kraushaar

    I appreciate your article quite a bit. You and I have followed down a a very similar path, and I’ve always considered my cross-language knowledge to be a great asset. In going through a month without work it seemed to hurt in resumes sometimes, and I’m still not sure why. Thanks for pointing out what I thought I considered obvious.

    • Igor Kulman

      I know the situation. I had a problem when looking for my first fulltime job with a resume with a lot of programming languages, knowing a bit about each one and none perfect.

  • miscsecurity

    I couldn’t agree more. Learning languages helps you think outside of a box that many languages can pigeon hole you into.

  • skimmas

    kinda offtopic, but I think you should increase the line-height in your post paragraphs to something line 1.2 or 1.5. It would make the text a lot more readable.

    • Igor Kulman

      good point, the template needs some tweaking

  • Pingback: Ежедневник kvarkson'a | 7 Ноября / Осенняя свежесть

  • http://nil elkaysoft

    I really love this your write up, am a .net programmer( but am thinking of moving mt programming style to c# but with your above write-up, i think am gonna move to c# in order to broaden my knowledge. Thanks

  • http://nil elkaysoft

    @keithb, you are absolutely right about the fact that you disagreed with the writer about ASP.NET can get tougher when u get into its advance topic and a good example is the WCF.

  • Yannbane

    I suggest you check out JavaScript!

    • http://deleted MangaLore

      I suggest you dont. The only thing you will learn is how to do it the bad way.

  • MangaLore

    I agree with you. Java really sucks.

  • Saleh

    i think .net stack is very comprehensive because c#, VB, f#, c++, web, win, mobile and…

  • geekware

    I recommend reading “The Little Schemer” to all coders. Fun and you will learn something!

  • einy

    Have you tried nemerle?
    It is what c# should have been. Nemerle has a plugin for Visual Studio.
    It seems that jetbrain is going to use nemerle.

  • Dan Sutton

    What a great article! What you’re saying should be something all programmers do: unless you learn everything that’s out there, you’re missing the point.

    I’d recommend highly that you get yourself a PC and set it up as an old DOS box, then experiment with assembly language programming — it opens your eyes to so much in terms of how the internals of a machine work — just from the point of educating yourself, I can’t overstress the importance of understanding how to program a computer in machine code.

  • Rohit Pitke

    Do you recommend doing projects to learn programming languages or advice learning language by reading tutorials or books first?

  • memosk

    For to be a complex polyglot you high level need is to learn MS c++. That’s true hardcore .
    if you see something like this :
    int wmain( int argc[ , wchar_t *argv[ ] [, wchar_t *envp[ ] ] ] );