Self-education can be as painful as it can be gratifying. The trick is to know when to expect what. Contents of this article are aimed at establishing a correct (IMHO) mindset in the topic of learning programming languages. I will try to convince you that knowing multiple languages well is the way to excell as a software developer. You'll get to know the benefits of polyglot programming, reasons for not liking it, what programming gurus have to say in this matter, and how to choose the next language to learn.
One of the most important skills of any engineer is being able to choose a tool for the job. Programming languages come with unique traits, which often makes them well suited for solving problems of particular type. Game engines are written in C++, as it enables precise control over system resources. Java has one of the best technology stacks for writing server-side business logic. It's good to code data processors in functional languages such as Scala or Haskell. The list goes on... Coding everything in the same language, if it's even possible, means not using the best tools out there.
If you're a hammer, everything looks like a nail.
~ Abraham Maslow's The Psychology of Science
Existence of a better solution than the one just developed—in another language or not—is highly probable. Different languages promote different ways of solving the same problems. Techniques learned in one language can be used in many others, which means, that by learning a new language you are getting more skilled at using all the languages you know. Each programming language you know makes you more capable of making decisions about technology and a better software engineer overall.
Another benefit from an engineer's point of view is doing full-stack development, which is lately getting more in-demand by employers. Many technology stacks are heterogeneous in terms of programming languages. Typically, different languages are used on different layers. Software developers familiar with entire technology stacks are more efficient at finding bugs and much better at performance and optimization work.
Most software developers have read something about functional programming and predicate logic during their period of formal education, but this knowledge stays very theoretical until something useful is created using it. As you practically try languages implementing other paradigms than you already know, you learn new idioms and techniques, while getting to know their pros and cons in the process. This is a great way to grow as a programmer.
Once you stop learning, you start dying.
~ Albert Einstein
While learning multiple programming languages, we unconsciously build a meta-language in our heads, which is then used to translate between programming languages. In time, this meta-language becomes very handy in learning yet new languages. A master of a dozen programming languages may start efficiently using a next one just after few-hour scrolling through its specification. This ability is referred to as a generalized language learning skill.
Trying new languages involves digging through forums and mailing lists. By introducing ourselves to the new community, we may learn about new ways of standardization, coding conventions, or even social interactions. Active involvement in multiple programming communities creates a potential for expansion of professional network.
Programmers, that are highly skilled in using many languages, are often the ones writing new libraries, frameworks and tools. If you are able to identify the need for a library that is already available in another language, you may also try to reimplement it in the language you're currently using. Examples of such successful reimplementations include (but are not limited to):
- std::future class from C++11 standard based on quite old Future from Java,
- Play framework for Java and Grails for Groovy, both based on concepts from Ruby on Rails,
- Clojure language, which is essentially a copy of Lisp that works on JVM.
One of the highest forms of contribution is language design. After mastering multiple languages from various programming paradigms, you can improve some of them by adding your 2 cents to the work of standard communities. People that see the need, have proper theoretical knowledge and feel up for it, may even want to start a project of a totally new programming language on their own.
As you learn more and more languages, the number of job opportunities that matches your profile raises. What's more, being a polyglot programmer gives you an advantage over other candidates for a position you may be interested in. With higher probability of recruitment resulting in hire, you can be more precise in selecting positions for which you would like to apply. This ultimately leads to being happier with your job.
Freelancers can utilize the benefits of knowing multiple languages even more. As freelancing jobs are project-based, there will be more occasions to change daily-used languages. The purpose of learning new languages will be to use them in the next project, instead of just getting better at programming. As in the case of permanent-job programmers, more languages means more job offers, more expertise and better work efficiency, but for freelancers better efficiency is also directly connected with more money.
Many succesful book authors and designers of popular programming languages have something to say about the importance of continuous learning.
Robert C. ‘Uncle Bob’ Martin writes in his second best-selling book titled The Clean Coder:
The frenetic rate of change in our industry means that software developers must continue to learn copious quantities just to keep up. Woe to the architects who stop coding—they will rapidly find themselves irrelevant. Woe to the programmers who stop learning new languages—they will watch as the industry passes them by. Woe to the developers who fail to learn new disciplines and techniques — their peers will excel as they decline.
In this statement he touches another problem (high-flying architects), but the essence is about learning. This guy has 40+ years of experience in computer programming. He's witness how many languages and technologies got obsolete.
The Pragmatic Programmer—a popular book by Andy Hunt and Dave Thomas—contains a list of very useful programming tips. Tip #8 “Invest Regularly in Your Knowledge Portfolio” states:
Learn at least one new language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut. Additionally, learning many languages is far easier now, thanks to the wealth of freely available software on the Internet.
Authors of this book took a huge part in creating the Agile Manifesto. Some Agile values were based on the tips from The Pragmatic Programmer.
Larry Wall—the author of Perl scripting language—lists following five languages as must-haves in the world of modern programming:
- Java, because managers like it due to the fact that programmers are easily interchangeable,
- Haskell—a language for geniuses by geniuses—even just for the sake of knowing how smart one must be in order to program in it,
- C, because most of the compilers, VM's and kernels are implemented in this language,
- Python, Ruby or Perl—one of the scripting languages—to have a tool for everyday use.
The most common reason for not learning another language is the lack of time. These days, not every software developer is a total nerd that do coding and sleep on the same chair. Some of us would like to have a life besides work. Sure, there's nothing wrong with that, yet we have to remember that the further in the process of self-education, the less time it takes to learn new stuff. An expert polyglot programmer should be able to educate himself, do active menthoring and write good-quality code, all during a highly productive 8-hour workday.
One must specialize in order to be good at something. This statement is quite often used as an argument against polyglot programming. And while the statement in itself is very true, there is an open question of how narrow a succesful specialization should be. Nobody is a master at every language he knows. That is not the point. We learn more languages because we want to be better software developers. We want to have broader views, know strengths and weeknesses of the languages we know by comparing them to new ones. Besides that, keeping up-to-date knowledge in more than five languages is virtually impossible.
At some point, after mastering several languages, a programmer may already know most of the features a language can have. What's the point of learning another language by then...? Well, it's not about language features. We learn new stuff to have more and more tools in our toolboxes. Knowledge of many language features is helpful when learning next languages, but this doesn't mean another language isn't worth learning. A language may have similar features to the one you already know, but it may have a better syntax, a different target platform or some detail, which makes it more suitable for a particular use case.
Another reason for not learning another language could be that languages are easy to learn in comparison with frameworks. In other words—learning a framework takes more time than learning a language. This is true for commercially standardized frameworks with very long specifications (e.g. EJB), yet there are many frameworks, which require very little learning and almost no configuration. All thanks to the concept called Convention over Configuration (CoC), popularized by Ruby on Rails (RoR) framework. Today's frameworks learn from each other and adopt the same good solutions. Generalized learning skill is also applicable in here.
Choosing The Next Language
So, you're a programmer with experience of a year or two and you use one programming language. What should you do next? There are so many options out there...
My advice is to take a look at programming paradigms on Wikipedia and choose something that is totally different from what you already know. If you know an imperative language, pick a declarative one. If you know meta-programming with reflection, try a language with template meta-programming. Choose a language with different model of concurrency, different features of the type system, different overall complexity, and even different target platform.
It is probably a good idea to check out which languages are in demand before choosing the next step in your learning process. Tiobe Index and IEEE Spectrum are good sources of information about trends in programming language popularity.
Making a Decision
When still in doubt about starting to learn another programming language, you may ask yourself some of the following questions:
- Is programming my passion?
- How much of a salary would I like to receive?
- What are my priorities is life?
- Will I move to management at some point?
Not everyone is ought to be the best, but there is a great, forever unsatisfied need for more experts in the field of software development. Experience of an average programmer is slowly declining as beginners are produced by universities in greater quantities every year. I encourage you to become an expert and make things just slightly better for everyone.
I hope that this article provides information helpful in making a decision about a career. Which path did I take? I think that's obvious. But what do you think? Are you willing to become a polyglot programmer?
- Detailed information about how full-stack developers are good at performance and optimization work can be found in Carlos Bueno's article on Facebook's technical blog.
- Good tutorial on how to learn multiple programming languages can be found on WikiHow.
- Robert C. Martin argues that Clojure is the best pick for a functional language on his blog.
- Question on Learning Multiple Languages Simultaneously at programmers.stackexchange forum contains information on pros and cons of learning multiple languages at once.
- Lauren Orsini describes the story behind Facebook's Hack language in article titled How Many Languages Do Developers Need To Know? posted on ReadWrite tech news website.
- Coding Dojo offers some good advice on what to focus on when learning new languages.
- Comprehensive discussion and suggestions of languages to learn can be found in thread on programmers.stackexchange titled (Why) Should I learn a new programming language?
- Big Think interviewed Bjarne Stroustrup and Larry Wall about five programming languages everyone should know. Both interviews are available on Youtube.
- Kira M. Newman lists her reasons for learning many programming languages on tech.co.
- Mary Branscombe describes her concept of causality between more programming languages and more money on pluralsight.com blog.
[ 1 ] Ultimate precursor of this style of testing is JBehave framework for Java.
[ 2 ] Preconditions class from Java is itself based on Eifel's require keyword, which was part of one of the early Design by Contract utility implementations.