Let's say you're new to programming, or maybe you've honed your skills at one language. What languages should you learn? And is it even worth the time and effort to become a multilingual coder?
Well, you probably know that learning multiple languages is part of the traditional university track--programmers with degrees in computer science will usually have trained in half a dozen languages by graduation. But what's the value of being a multilingual coder in the workplace, where your projects are less theoretical?
"Not only are languages different tools for different jobs, but they are technologies that shape how you think about programming," says Richard Pattis, a senior lecturer of Informatics at UC Irvine who invented the Karel educational programming language in 1981. But this isn't an outright endorsement of learning two-plus languages--it matters which ones you pick. "Learning similar languages might not progress your thinking much," says Pattis.
To expand their minds, Pattis recommends that versatile programmers learn languages from different language paradigms, whether it be object-oriented languages (e.g., C++/Java), functional languages (e.g., ML and Haskell), scripting languages (e.g., Lisp and Python), logic-based languages (e.g., Prolog), or low-level languages (like C, the Java Virtual Machine or a machine language).
The point is not necessarily fluency, but gaining a conceptual vocabulary to attack problems in new ways. Good programmers don't just learn how to code--learning core concepts teaches them how to wrap their brain around a problem and produce efficient code to solve it.
Fluency Is Good, But Smart Thinking Is Better
If a programmer's fluency matches the language used in the project they're interviewing for, obviously that helps--but that's less important than a programmer's problem-solving/architecting skills. All top-tier industry employers think that way, says Google software engineer Edward Lin.
"I think that puts the cart before the horse. The question shouldn't be 'What language should I pick up'--instead, it should be 'what type of developer do I want to become,'" Lin says. "Some development positions require you to know more languages, but most will require just one. You can become highly sought after with just knowing one language."
Some positions don't need multilingual expertise, like an operating systems developer. But by the same token, an interviewer won't presume that a multilingual programmer isn't qualified for a position that only really "needs" one language. Proficiency is in the task accomplished, not in the quantity of languages known.
But Lin does have a suggested order of languages for newbies to learn: first Python, because it's the most readable and syntactically tight, and then C, the long-winded general-purpose coding language that is still highly sought after, after 40 years in the industry.
In his now-classic "How to Become A Hacker" open source champion and Jargon File editor Eric Steven Raymond echoed the sentiment to learn Python first. Later, he advises learning C as it's the basis of Unix--but also to learn the trade-off between the code-intensive C that takes little machine memory and the memory-intensive Python (and its ilk) that require fewer lines of code. Though crude, this distinction is the first step for new programmers to realize that learning multiple languages teaches them how (and how not) to code.
But Seriously--Which Language Next?
For those without a chosen developer destiny who just want to try something new, there are a few things to consider. One could look at LangPop's language popularity graphs or TIOBE's popularity index and see that C, JavaScript, PHP, Java, C++, Python, and Objective-C dominate many of the different popularity metrics--languages also cropping up in "Languages To Learn In 2014" roundups. In short, people are talking about these languages, people are using these languages, and people are hiring for these languages.
One of the most important assets when considering a new language is whether it has a community large and involved enough to answer your questions. Whether from Stack Overflow, GitHub, or even your circle of coder friends, having access to experienced programmers is key to get you learning from mistakes, not quitting in frustration.
The most important thing NOT to do is listen to one person's opinion on the "best" programming language. Stack Overflow's classic "Gorilla vs. Shark" post exaggerates an infamous 2008 inquiry when one user asked whether they should learn Python or Perl and the Q&A exploded with personal vouching and condemnation. Nothing infuriates programmers more than asking which language is superior. Those kinds of super-general comparisons are too apples-to-oranges for professional programming communities to take seriously.
Instead, use Stack Overflow as a kind of Office Hours--and maybe you won't need to take the class at all.
The Proper Road to Learning Code From Scratch
While delving into the wide world of coding seems intimidating, there are so many resources online that you really don't need to spend time in a classroom to get a job coding. Jason Stockman is a front-end developer based in Cambridge, MA who builds websites using HTML/CSS, JQuery, and PHP/MYSQL. He's also the cofounder of ProtonMail, an end-to-end encrypted email provider based in Switzerland. Stockman was a few classes into his computer science college track when he discovered that he knew more than his professors--and promptly dropped out to study online on his own. Even back in 2007, the Internet's resources were fresher than the course's 1999 textbooks.
To him, Stack Overflow was like graduate school: You need to have the basics down before they'll even let your question get answered. Since it's cultivated, only the best questions are up for discussion, leaving lots of rich content, which encourages an involved community.
While he focuses on the User Experience languages that make his websites flow, Stockman also spends about an hour a day catching up on coding news. It keeps him abreast of trends, like the rising excitement over Node.JS, a networking and server-side software platform written in JavaScript.
"Having my ear to the ground on a daily basis helps me decide the next hot thing to learn," Stockman says. "Us developers decide, not business people or anyone else. As a community we actually put ourselves out of business sometimes by adopting new tech. It's kind of scary."
The Academic Foundation
But as the expanding market for programming jobs makes coding an ever-sexier proposition, curious neophytes get excited about Learn Coding Quick sites like Codecademy and w3Schools. This gets trained programmers riled up to explain what those sites don't: that Computer Science students learn the mathematical and rhetorical theory underlying coding language. This lays the groundwork for learning ANY new programming language, which all borrow from programming elements developed in computing's infancy.
"Rule of thumb, about 80% of what exists in programming languages was already available in LISP around 1970," says Crista Lopes, professor of Informatics at UC Irvine. Prior to teaching, Dr. Lopes was a research scientist at the Xerox Palo Alto Research Center and was part of the group that developed Aspect-Oriented Programming and started aspectj.org.
"Deep down, there is no such thing as 'multiple languages,'" Lopes says. "There are a variety of expression concepts, and programming languages are collections of these concepts; some of those collections have some sort of principled consistency among the concepts they incorporate, others are just a fruit salad. Most of the concepts exist in many programming languages, even if they are disguised in different clothes, different syntax."