Financially speaking, which computer languages can earn the most for the programmer?: originally appeared on Quora: The best answer to any question. Ask a question, get a great answer. Learn from experts and access insider knowledge. You can follow Quora on Twitter, Facebook, and Google+.
There is a short answer, but this a borderline religious discussion, so it requires some context first.
I've hired many software engineers, and the single most valuable skill is the ability to pick up anything and master it quickly.
Some years ago an offshore company was producing Java for me with inconsistent quality. I was able to build remote teams by looking at their resumes, but I couldn't interview them individually because they didn't speak English. This kind of constraint makes for an interesting experiment.
The developers' resumes looked good, with years of experience. Still, the code was often buggy, hard-to-read, and poorly organized. As an experiment I started asking just for their C++ developers. Some of them didn't know Java, but I was willing to pay them for a few weeks to learn it. With the help of their coworkers, they picked up the language and its idioms, and excelled as our top Java programmers.
So here's the short answer: Learn C/C++
You might never use it professionally, but it contains a lifetime of lessons. And the hardest problems, the ones that the top engineers are asked to solve, will sooner or later hit some foundational C code.
Here are some things that are written in C:
- The Java virtual machine is written in ANSI C
- Linux is written in C (and some assembly, but mostly C)
- Python is written in C
- Mac OS X kernel is written in C
- Windows is written in C and C++
- The Oracle database is written in C and C++
- Cisco routers, those things which connect the Internet, also C
Name anything that is foundational, complex, and performance critical. It was written in C, with a sprinkling of assembly thrown in.
C will make you a better Java programmer. You'll know when the JVM is using the stack and when it's using the heap, and what that means. You'll have a more intuitive sense of what garbage collection does. You'll have a better sense of the relative performance cost of objects versus primitives.
C++ will make you a better Python programmer. Its class mechanism is largely based on C++. You'll have to learn to write clean, well-organized code if you ever expect to maintain it. You'll learn to be careful with your global variables.
C will make you a better Objective-C programmer. You'll know how to manage your refcounts and which piece of code should "own" an object. You'll be able to avoid memory leaks.
So which is better C or C++? I lean slightly to C++ because they are very similar, but with C++ you get the added benefit of object-oriented programming. Even if you decide you're only ever going to program in functional languages, learning how to think in OO teaches organizational patterns that are critical to engineering and maintaining really large projects.
So maybe you won't make as much per hour as you would during some brief, weird supply/demand anomaly like COBOL in '99, but once you know C, you can learn that language, and the next, and the next. Because if there's one long-term constant in this industry, today's hot skill is a quaint novelty in a few years. Learn the skills behind the skills and you'll do great.
I should clarify...
Nowhere do I say you should program in C for a living. Or learn C as your only language. Or that you can make more per hour on C than programming in Foobar. Generally speaking, you shouldn't even program your applications in C unless you have a really good reason.
But you should learn C. Because it's the abstraction other languages use to understand the physical machine. You can strut like a champ when the other programmers are still scratching their heads. And that will make you more "senior" and earn you more money in the long run.
If you want to be the best and best-paid Formula 1 driver, learn how to take that engine apart. Not because it is your job, but because it will make you better at your job. And as the cars change and evolve over time, you'll get what makes them different too.
Q: How do become a better speaker of all Romance languages?
A: Learn Latin (and a bit of Greek won't hurt).