Which Programming Language Should I Learn?
With hundreds of programming languages out there to choose from, it can be difficult to know where to start. What makes matters worse is that the question of which programming language someone should learn can get people quite hot under the collar, as they insist that their preferred language is the one true way, with all other languages being a waste of time.
So without wanting to be too partisan about it, here’s what I think…
1. Don’t learn a language – solve a problem
Rather than think about which language you should learn, it is much better to think about which problem you would like to solve.
This video makes some really important points about changing your thinking from “which language?” to “which problem?”
For me, I started trying to learn python by working through examples, books and online guides. This approach to learning could only take me so far – I only really started getting to grips with it once I started working on a problem that I cared about.
The problem I found to solve was that I wanted to batch process some simulation data using an existing analysis tool. The analysis tool worked really well, but there wasn’t a command line interface, so I was having trouble using it on large numbers of files. With a definite goal in mind, I was able to download the code, figure out which bits I needed to modify to make a batch-processing command line interface.
As I knew that solving this problem would make my life easier, it became clear which bits of the python language were important to me. What’s more, at the end of that period of ‘learning’, rather than having a bunch of toy scripts to just clog up my harddrive, I’ve got a useable, useful program that I use on an almost daily basis, and saves me hours of work.
2. Use the right language for the problem
Once you’ve figured out what your problem is then you can start thinking about which language it makes most sense to program the solution with. When Linus Torvalds made the first Linux kernel, it made sense for him to use the C language. If you think the solution to your problem is an app, you’ll probably need Java or Objective C. In my problem above it made sense to use python. I already had some experience with the language, and was keen to learn more, but more importantly the original project was written in python.
By using python to build on an existing python project, it was simple for me to import modules, use existing functions, and combine my new code with what was already there. I could learn and make progress much faster than I would in trying to translate between the project and my chosen language.
3. Learn the language used by the people around you
If you’re still not sure which language you should be using to solve your problem, the best bet is to use the language that is known by the people around you.
I once read that the operating system you should get your parents to use is the one that you are most familiar with. You know that you’re going to have to be helping them out with it at some point, so why make your life difficult by giving them access to a whole load of menus you’ve got no idea about.
The same applies to programming languages. Only this time you’re the parent who doesn’t know what they’re doing, relying on your friends/colleagues to help you out. If you pick a language that people around you know, they’ll be able to help you out when you get stuck. It’s true that with things stackexchange, you can have a global community of coders to help you out, but I still think there’s no beating being able to call someone over to point out where you forgot to close a pair of brackets.
4. Teach yourself to program in 10 years, not 10 days
You’ll see all over the place guides to learn a programming language in a month/a week/a day. I think I’ve got a book for learning C in 21 days (as if…) kicking around somewhere. Unfortunately if you actually want to learn a programming langauge, it’s not as easy as all that. Instead you have to keep practising and challenging yourself over a long period of time.
So once you’ve solved your first problem (point 1), go and find another one which will push the boundaries of what you already know and understand. In my case, once I’d figured out batch processing for some of my analysis, I was able to fairly quickly do the same for other problems, each time learning something new, or reinforcing an old concept.
The thing is, most of the time which language you learn isn’t important so much as what you do with it. Once you’ve got a handle on how one language works, you’ll find it much easier to figure out a second or third. So if you find there is a language you’d like to learn or you think is really cool, then find a problem, or a project that makes use of it and get stuck in!
5. Learn Python
After all that I’ve said, if you twisted my arm to recommend one language for you to learn, it would have to be python. It’s very well supported online, and there are thousands of projects out there for you to use for inspiration and get involved with.
Perhaps there are faster langauges, or ones better suited to certain problems, but I’ve found python lets me do the things I want to do, without kicking up too much of a fuss along the way.