I see this question asked almost every day, and if I’m the one answering, I almost always say the same thing. Let’s explore choosing a first programming language for a beginner to learn. We’ll talk about what to learn, what to look for, and why.

Choose the Right Tool for the Job

One frustrating answer I hear a lot is “Choose the right tool for the job”. C++ isn’t a good choice for web apps, but may be great for building an operating system or a game. Rust is good for systems programming, but might not be the best for mobile apps. The problem is that there’s a LOT of overlap. There’s dozens of options for each type of project you could work on.

So one factor in choosing a language is making sure that the language you pick will work for the type of project you want to build: Read more about Choosing the Right Language.

When it comes to choosing a first programming language, you want to look at a couple different factors:

1. # of Jobs/Work in your area

2. # of total programmers and tutorials available

3. Flexibility of the Language

4. Developing your skills

The language you pick is not nearly as important as how you learn. Your focus should be on building your portfolio. Start with simple projects, and build stuff. Most languages are similar, and once you learn one, the second and third languages come much quicker.

# of Jobs/Work in your area

Javascript is an extremely popular language. Javascript is a front end language that helps you make interactive websites. Things like clicking a button, a unicorn flying across the screen, etc… are almost always Javascript in action. On the front end you have a lot fewer options. You can use PHP, Python, Ruby, Java, or a bunch of other things on the backend, but nearly every website around is using Javascript in the browser, which means that no matter what you’ll have plenty of work available for a LONG time if you know Javascript; It’s not going anywhere anytime soon. Don’t believe me? Look up “Javascript” on a popular job board. It is everywhere.

SQL is the language of the “Relational Database”. Most websites that have data like user profiles, likes, comments, todo lists, blogs… all need to store the data somewhere. Usually that’s a database like MySQL or Postgres. In order to interact with the database and get your information out of it you need the language SQL.

Because Relational Databases are so common, and almost every website, mobile app, etc… has a database and data, SQL is naturally extremely popular.

It’s true that there’s quite a few other databases available like CouchDB, Mongo, Redis, etc… but a lot of times they’ll work alongside a relational database, and SQL has a HUGE market share and is not going anywhere anytime soon. Again, look at any job board and search for SQL.

PHP

It’s split pretty evenly in a lot of locations between back end languages, so it’s not always a bad idea to just pick something you’re interested in. That said, PHP has a specific advantage in that it’s used by a LOT of websites. About 80% of the websites on the web where the server is known uses PHP. 80%!!! That means a nearly endless supply of jobs. Especially for Freelancers who like helping small businesses with their WordPress blog or small business website.

Unfortunately, it gets a little more confusing because a lot of websites that use PHP are low-traffic websites and personal blogs. Overall, PHP is one of the most popular backend languages and can supply you with a ton of work opportunity.

Learn to Code for Free

Learning to Code is simple. You just need to learn the right stuff at the right time. We'll show you how to learn to code quickly and easily with our step-by-step guide.

envelope

# of Programmers and Tutorials Available

How many jobs and programmers there are for a language directly relates to how many tutorials are available in that language. It’s probably not a big deal, but if you get stuck, the more information available, the easier it is to get un-stuck. You want to have lots of documentation, examples, and tutorials to play with in order to get started. That’s part of the reason why PHP, Javascript, and SQL are good for beginners.

Flexibility of the Language

This one’s hard because most languages can do most things. There’s a lot of overlap between them, but I think a combination of PHP, Javascript, and SQL can take you almost anywhere you want to go, at least for a first language (set of languages).

Javascript wins hands down in flexibility. It’s used both on the front end AND back end. It’s used to build a lot of very popular frameworks and libraries like Angular, React, coffeescript, ember, jQuery, and a bunch of others. Using Node.js you can build your entire application in Javascript thanks to frameworks like Meteor and Express. It’s almost always present in web apps on the front end, so even if your back end is in Python, Ruby, Php, Java, or whatever… Javascript will be there too.

People are even using Javascript to build games, Mobile apps (React Native, ionic, etc…), and embedded systems! At a hackathon we used Javascript on a microcontroller for a self-driving vehicle.

PHP is both popular AND flexible. Yes you could replace it with Python, Ruby, or some other backend language and still have a great or even better application, but PHP affords you one extra advantage that the others don’t. Many popular CMS platforms are built on PHP. WordPress, Drupal, and most others are built in PHP. So not only can you build your “startup” style product with PHP, you can also use it to work on WordPress and Drupal sites.

Because WordPress powers about 20% or so of the web, PHP is a very nice language to know. Especially if you want to become a freelancer and work for yourself. Technically you don’t have to use PHP to work on WordPress. They have an API that you can use to build plugins in any language, but PHP is probably ideal for most WordPress work.

SQL is also very flexible. Nearly every application has some sort of data to be stored. SQL may not be the best choice for every situation, but it’s still capable of handling a wide variety of problems.

Developing Your Skills

SQL does fine in this regard, but Javascript and PHP are not perfect. In fact, when some programmers are asked to describe PHP or Javascript, they may describe it as “gross”.

They are not ideal languages for teaching you best practices, and they will allow you to develop really bad habits as a programmer. I think everything else that is positive about the languages far outweigh any negative aspects, but it’s something to at least consider. And you can write good or bad code in any language.

If you want to develop good programming skills, you’ll need to pay extra attention to how you code. A much better language to learn on would probably be Python. I want to say Haskell or Rust, but those are probably not suited for beginners. They have a small user base, and are quite a bit more difficult to learn.

Conclusion

As a beginner you want a popular and flexible programming language. You want to be able to find work AND build a wide variety of applications. For these reasons, I recommend these as your first languages:

Tied for First place: Javascript and SQL

Second Place: PHP (because of WordPress and # of jobs)

Third Place: Python (Better for learning good habits. It’s also popular, and extremely flexible)

Honorable mentions: Haskell and Rust! Once you’ve built a couple applications and know your way around, you should definitely try building something with Haskell or Rust.

Learn to Code! Get Free Tutorials & Courses Straight to Your inbox!