Writing programs is the process of breaking down problems into individual steps, and translating those steps into the very specific language a computer understands. These instructions are written in a programming language.
So, which programming language to pick? While it’s definitely feasible and even common to learn two or more programming languages, it’s still important to start with the right one — a programming language that’s easy to use, serves your objectives and career goals, and is flexible.
To help illustrate the criteria, here’s how the following languages rank:
C is the oldest of the bunch, at 47. You might know it from the macOS, Linux, and Unix operating systems; classic games like SimCity and Doom; or NASA missions like the Curiosity Rover. While it’s been replaced by newcomers in a lot of areas of programming, it’s stuck around due to the ease of bringing it to new platforms.
Python was created in 1990 in the Netherlands and named after the British comedy troupe (not the snake!). Much of its early popularity was due to its use on the web — including websites Reddit, Dropbox, and Spotify — but it’s increasingly being used for data science and other kinds of scientific computing, including in the Large Hadron Collider. Check out The Basics of Learning Python here on Wyzant for more info about this incredibly useful language.
PHP was designed for personal websites (it initially stood for Personal Home Page) but grew to be a full-featured, if quirky, language. It powers some of the best-known websites, including Wikipedia, Facebook, and WordPress.
Java was made for enterprise development, and enterprises embraced it. Besides powering the behind-the-scenes operations of Fortune 500 companies, Minecraft was written in it, as were almost all Android apps. Rather than running directly on the operating system, Java runs on an intermediate virtual machine, which increases portability.
Ruby hails from Japan and has the explicit goal of making programmers happy. Ruby is used for much of the web, including well-known sites like Urban Dictionary, Kickstarter, and Airbnb.
Swift is a relative newcomer, having been introduced in 2014 by Apple to ease development on iOS and macOS. It’s used in popular iOS apps Pandora, Twitter, and Groupon.
Without further ado, here are the five criteria, from most to least important:
You want an easy-to-use programming language, so you can focus on learning how to break down problems and translate them into code, rather than being tripped up by minutiae. I emphasize accessibility because having to learn both basic programming concepts and the quirks of a given language can be frustrating. Sometimes beginners are stymied by an unfriendly programming language and come away thinking they’re bad at programming in general. Using a well-designed and friendly language helps mitigate that risk and sets you up for success.
What makes a programming language accessible? Here are a few things to look for:
Languages with fewer symbols and abbreviations tend to be more intuitive.
Having to remember multiple ways to do similar things, each for a different context, makes a language harder to learn.
Especially when you first start programming, it’s best when you don’t have a lot of code needed before you write the code for the problem itself. A good way to judge this is to look at example programs for “Hello World” or other simple tasks.
Good error messages
Errors are inevitable, so it helps to have a language where the error messages have clear wording and point out where the error occurred. Ideally, it also suggests potential fixes.
Easy use of libraries
Much of modern programming involves standing on the shoulders of giants by using libraries — pre-existing code designed for use in other programs. In addition to being practical, libraries are also a helpful way to learn because they mean you don’t have to build tons of things from scratch.
2. Your Objectives
Languages have their own strengths, so it’s good to pick a language that matches what you want to use the language for. Programmers tend to break programming into a few different categories that correspond to the kinds of programs being written or the problems being solved:
Game programming includes not only major titles like Minecraft and Fortnight but also small and independent games. Java and Swift (for macOS and iOS) shine for this type of programming.
Mobile development involves creating apps that run on smartphones, usually iOS and Android. Here your options are more limited: Swift for iOS and Java for Android.System development involves creating low-level software that makes a computer work or fixes it when it doesn’t. Of the languages we’ve looked at, C is your only choice. You may also wish to check out Rust or C++, but this article won’t evaluate them like the other ones because they tend not to be used as first programming languages.
Embedded development involves programming the small computers that power devices — think smart thermostats, sensors, or routers. C is the traditional choice for embedded development and runs on the greatest variety of microcontrollers, the small and energy-efficient processors often used in these devices. However, there are versions of Python and Java that run on many of these as well.
3. Job Prospects
Many people are interested in programming because it’s a growing industry, so it’s worth considering how many employers are looking for programmers in that field. Of course, if you’re interested purely out of curiosity, you can overlook this point.
Keep in mind that you’re probably not looking for just any job, you’re looking for a job in your area at a company you want to work at. What’s hot among Silicon Valley startups doesn’t matter if you want to work for an established company in Chicago or a non-profit in New York City. If getting a job is important to you, take a look at programming jobs at companies in places you’d like to work and take notes on what programming languages they want. This will also give you a sense of other technology experience and non-technical skills you need to have. If the post is particularly informative, it’ll give you the kinds of problems you’ll be solving and the other roles at the organization you’ll be working with.
4. Overall Popularity
It might seem shallow, but there are very good reasons to pick a popular language. The more popular a programming language is, the more likely you are to find answers to specific questions, learning resources, and tutors.
While, it’s good to consider popularity, don’t worry about specific ranks as much as their rough position in the pack. Of the languages we’re comparing, they’re all routinely in the top 10, except for Ruby, which usually ranks between 11th and 15th. For the purpose of picking a language, they’re all popular enough.
Languages that tend to appear on rankings but not at the top can be good, but you might find one result when you Google your question rather than a dozen. That’s fine if the one answer is complete and understandable, but a problem if it is not. You may want to reserve these less-popular languages for your second language unless you have other compelling reasons to use them.
If a language is too obscure to appear on ranking lists at all, reconsider. There are some really intriguing languages that are obscure — Prolog, Forth, and APL have piqued my interest in the past — but you’ll struggle finding resources and people to help you. I recommend building your problem-solving ability by learning another language first, then coming back to it.
As a beginner, you likely don’t know exactly what kinds of programs you’ll be creating. Even if you do have a very specific vision, you don’t necessarily know the technologies that will work best. Choosing a flexible language gives you both the opportunity to learn different approaches and give you a variety of options when you’re solving problems, so you can choose the best approach or technology. Major ways of solving problems and organizing programs are often referred to as paradigms. You may have heard of “Object-Oriented Programming”—that’s a paradigm.
I’m using flexibility to refer to both the adaptability of the language itself — whether the language enforces a particular paradigm or gives you options — and the size and variety of libraries. A library might provide a framework for web development, add HTTP support, calculate planetary positions, process large amounts of data, create animation or do machine learning.
Incidentally, flexibility is the main downside of teaching languages like Scratch, Logo, and Alice. While they often offer a gentle path to programming and can be a lot of fun, the path often suddenly ends ends after you learn the introductory concepts and try to build actual programs.
Here are how the languages compare in terms of adaptability:
- Ruby has powerful metaprogramming, or a program that writes itself, that makes it the most flexible. Unlike other highly flexible languages, it is very approachable.
- Java strongly favors an object-oriented approach and C has few options beyond functions so neither of these are particularly flexible.
Here’s how the languages compare in terms of libraries:
- Swift is not as established but does benefit from Apple’s rich set of APIs for application and mobile development.
- PHP is well-equipped when it comes to web programming itself, but is limited once you go beyond that.
How to Learn to Code
Regardless of what language you pick, there are a variety of ways to learn how to code:
College courses are good if you benefit from structure and having classmates. They can also be a good choice if you want to learn more theory.
Online courses are more flexible, and you have more alternatives if the first one you find isn’t a good fit.
If you like reading or have a physical reference, a textbook can be a good fit as well. If you go that route, make sure you actually complete the exercises — it’s hard to learn programming from simply reading about it.
Online written tutorials tend to make it easy to read them while trying the code out for yourself, but they vary the most in quality.
I strongly recommend not giving up on a language (or programming in general!) when it gets hard. But don’t be afraid to give up on a book or course that isn’t a good fit. And even if you find a great resource you love, it still helps to find a second one to reinforce the concepts.
Programming requires a new way of thinking, so it can be tricky if you haven’t done it before. If you get stuck, consider hiring a tutor. A tutor can not only help you get unstuck, but can also clear up underlying misconceptions and suggest new resources and learning strategies.
Wyzant has a network of over 23k coding tutors. Search for a tutor with expertise in the languages and technologies you’re interested in, and start lessons as soon as you’re ready to dive into programming.