Coding in Flow logoGet my free React Best Practices mini course
← Blog

What Programming Language to Learn First? The Definitive Guide

Sep 7, 2022 by Florian

Featured image

Do you want to start learning programming but don't know which language to pick? This opinionated guide will clarify this question once and for all, leaving you without any doubts so you can start coding today.

Table of Contents

Intro

The sea of programming languages is huge and there are even new languages popping up every year. While not all of them gain traction and become relevant, you still have a ton of options to choose from. That's because many programming languages, like JavaScript and Python, can do similar things and create applications for the same platforms. But not all languages perform equally well in every use case.

This guide will help you find the best programming language to start with, depending on your current goals and what you want to build. Each section covers a different platform and the right language to pick.

If you're too lazy to read, here is an infographic I prepared that summarizes this article. You're welcome to share this graphic, but please leave the Coding in Flow mark on it and link to this post.

(click the image to enlarge)

What programming language to learn infographic

I highly recommend that you read on for more details about each choice.

All the languages and frameworks listed here have active communities and well-maintained documentation where you can find more help if you're stuck.

Before we get to the list, just a few clarifications to put you on the right track.

It's Not a Final Decision

Of course, this article can only provide a guideline. If you are a beginner and don't know where to start, the languages listed here are great choices. However, they might not be the best choice for every kind of application. More specific application demands might require you to pick a different language later. But don't worry, once you learned one programming language, learning another one is much easier.

Most of the popular programming languages look very similar and only differ in small details from each other. Learning the syntax of a programming language is not the hard part about programming, but learning how to solve problems and think about code. So don't overthink your decision. You can always switch to a different language and platform later. Just pick whatever seems interesting to you right now and start with that.

Don't overthink the choice of your first programming language. Most of them have very similar syntax and once you learned one programming language, learning another one is much easier.

Also, you might need to learn secondary languages along the way in order to build real projects. For instance, you might want to add some kind of database so you need to understand its query language as well.

Job Requirements

All languages listed here are in high demand and have healthy job markets. Of course, if you already know that you want to work in a certain position at a certain company, you should check the job requirements for that role and see what technology they want you to know. Otherwise, just pick the topic that interests you the most.

The following sections will guide you through the different options. Each headline represents a kind of application you can build and the best programming language to get started with it.

I Want to Do a Little Bit of Everything

Learn: JavaScript

Maybe you decided that you want to learn coding, but you don't have any specific platform (web, desktop, mobile, ...) in mind yet. In this case, JavaScript is a language with which you can't go wrong. I love JavaScript because you can do almost anything with it.

Almost every single website out there uses JavaScript to make its content interactive. When a website does something when you click a button, when it plays an animation, every dropdown menu or interactive effect, all that is done with JavaScript. Without it, websites would be just static text, images, and links.

But also many web servers are written in JavaScript. My first startup, TutHub.io, used JavaScript for both the frontend (what you see in your browser), with React and NextJS, and the backend server (where the data is stored and processed), with NodeJS and Express. If you want to build mobile apps, you can use React Native, which is another JavaScript framework that lets you build cross-platform apps for both iOS and Android. Similarly, you can create desktop apps that run on Windows, Mac, and Linux using Electron. And you can even write browser and mobile games with one of the various JavaScript game engines.

While JavaScript might not be the best choice for every situation, it's extremely versatile and also very popular. It's one of the most in-demand programming languages and the learning resources are plenty.

Because JavaScript is a dynamically typed language, it's a bit easier to learn for beginners than some other languages. The downside is that it also makes it easier to add bugs to your code. Once your projects get bigger, you can upgrade to TypeScript, which adds a static type system to JavaScript. This makes the language a bit more complicated to use, but also less bug-prone. But don't worry about that right now, just start with JavaScript. You will notice when it's time to move to TypeScript.

I Want to Build Websites

Learn: JavaScript + HTML + CSS

If you want to build websites (here meaning the frontend, so what people are interacting with on the screen) you need to learn HTML, CSS, and JavaScript.

HTML defines the structure of a website, like where to put text, titles, images, links, and so on. CSS is a styling language that makes websites built with HTML look good. They are both technically not programming languages because they don't execute instructions. JavaScript is what makes these websites interactive, as explained in the previous section.

Comparison: A blog post page on TutHub with and without CSSComparison: A blog post page on TutHub with and without CSS

For frontend development, learning HTML and CSS together with JavaScript is basically your only choice, unless you want to rely solely on template systems like WordPress that handle these things internally for you.

For the backend, meaning the server that communicates with your frontend website to store data, authenticate users, and do all the "behind the scenes" stuff, you have more options available. Popular backend languages are PHP, Java, and Ruby on Rails, amongst others.

But as I mentioned in the previous section, you can build web servers just as well with JavaScript by using a framework called Express that runs on NodeJS. Both of them can be downloaded and used for free. This way you don't have to learn an additional language to try out full-stack (meaning frontend + backend) web development. Remember, you can still try out different languages later.

A cool thing about building websites is that you can make them responsive with the right CSS code. Responsiveness means that the website adapts its layout to the size of the display it's shown on. This is especially important for mobile phones, which have much less space than a computer monitor and display content vertically instead of horizontally. With the right CSS code, you can make your website look like a mobile app on smartphones without having to actually build a real mobile app.

Because of this flexibility of web development with JavaScript, it also makes a great choice for startups. You can build full-blown apps that work on any platform that has a web browser, without having to learn another language (except maybe a database language).

If you don't want to build websites but applications that are optimized for specific platforms, like smartphones or desktop PCs, read on.

I Want to Make Games

Software applications are broadly categorized into games and utility apps (usually just referred to as "apps"). Both can be exciting topics to get into and turn into a lucrative career.

To start learning game development, you want to use one of the existing game engines, with the most popular ones being Unity and Unreal Engine. A game engine is a development environment specifically designed to build games. It gives you the tools to implement physics, graphics, special effects, sounds, and everything else a game needs, without having to code all of that from scratch. Both Unity and Unreal Engine are free to use until your games hit a certain revenue threshold. And they both let you export your creations to different platforms, including PlayStation, Xbox, PCs, and mobile devices.

While you can build small browser and mobile games using JavaScript, the real, big games are written in languages like C# or C++ with more powerful tooling. C# and C++ are both strongly-typed and object-oriented programming languages, which, in short, means that they let you write code in a way that represents real objects in the world. This helps you keep your code well organized and your game free of crashes. In fact, all languages recommended in this post, except for JavaScript (without TypeScript), are strongly-typed and object-oriented. It's a battle-tested way of writing code.

Which language you should pick exactly depends on the kind of games you want to work on.

I want to work on smaller indie games

Learn: C#/Unity

Between Unity and Unreal Engine, Unity is considered the easier game engine to get started with. It uses the programming language C# (pronounced "c sharp"), which is considered a beginner-friendly language. The user interface (short "UI") of Unity is also simpler than that of Unreal Engine.

The user interface of UnityThe UI of Unity is very clean and not so overwhelming for beginners

Unity is a great choice for indie developers that want to make games alone or in a small team, and who don't need to have the absolute best graphics. Especially mobile games are a popular and lucrative niche for indie game developers right now. When you look at the list of popular games built with Unity, most of them are more casual 2D or 3D games, like Pokemon Go, Cuphead, and Hearthstone.

One of Unity's strengths that is especially useful for small indie developers, is its huge asset store, where you can purchase ready-to-use graphics, sounds, special effects, and everything else a game needs. This can be a big help if you want to build a game by yourself and don't want to learn additional skills like graphic design.

While Unity has all the necessary tools to build high-end 3D experiences with modern graphics and special effects, more AAA games are built with the Unreal game engine instead.

I want to work on high-end games in a big game studio

Learn: C++/Unreal Engine

Unreal Engine is another powerful game engine, mostly used for 3D games. It's known for its excellent graphics that surpass what's possible with Unity. Unreal Engine powers some of the most impressive AAA titles, like Batman: Arkham City, Gears 5, and Fortnite.

In Unreal Engine, you write code using C++ (pronounced "c plus plus"). C++ is the most commonly used programming language in the video game industry. In fact, game engines themselves are usually written in C++, even Unity.

Compared to languages like C# and JavaScript, C++ is a more low-level language that gives you more control over memory management and the underlying hardware. This makes it possible to write very performant code which is important for resource-intensive games. But it also makes the language harder to learn and use.

If you want to get a job as a game developer who works on high-end games, and if you can take a challenge, C++ can be your starting choice. The tutorials are out there and Unreal Engine gives you some handholding too, for example in form of its ready-made Blueprints, which allow you to create game logic without writing code. Unreal Engine also has an asset store though it's not as extensive as Unity's.

I Want to Build Native Mobile Apps

Similar as for game development, while you can build mobile apps using a cross-platform framework like React Native with JavaScript, it doesn't offer the same possibilities as a truly native app. Even though "React Native" has the word "native" in it, it's not what we mean when we say "native app". A native app is an app that was built using the programming language and development kit specific to a particular platform. This way you can write code that is "closer to the metal", meaning that it supports all the features that the platform has to offer, while at the same time being more performant. The downside of building a native app is that it won't run on any other platform than the one it was written for.

These days, the smartphone market is divided into Android and iOS, which both have their own native languages and toolsets.

Android

Learn: Kotlin

Since 2017, Kotlin is the primary language to build native apps for Android. Prior to that, Java was the only choice we had. You can still use Java to write Android apps, but it's not recommended unless you're working on some old legacy project. Kotlin has a more concise syntax compared to Java, a better type-system with integrated null safety, and many other language features that make it much more pleasant to work with. Also, Jetpack Compose, Android's new powerful UI framework, only works with Kotlin.

If you want to start building native Android apps, learn Kotlin. You only need to touch Java if your job requires it.

It's interesting to note that Kotlin is currently transforming into a cross-platform language, which is possible because it's based on Java's virtual machine, which allows the code to run on almost any device. However, right now, Kotlin is not a popular language of choice for anything outside of Android development.

iOS

Learn: Swift

Similar to how Kotlin replaced Java for native Android development, Swift replaced the older programming language Objective-C on iOS. The benefits are similar too: Shorter syntax, a better type system, null safety, and so on.

Swift was created by Apple specifically to build apps for the Apple ecosystem. While it's open-source and can be used on other platforms as well, it's not a popular choice anywhere else.

With Swift, you can build native and highly performant apps for Apple's operating systems: macOS, iOS, watchOS, ipadOS. But you will need a Mac to do that because Xcode, the development environment by Apple, only runs on macOS. Of course, there are ways to work around this, like coding on a virtual machine that runs macOS on another operating system, but this won't give you the best developer experience.

If you don't want to buy a Mac but still want to build apps for iOS, your only other option is to use a cross-platform solution like the earlier mentioned React Native. Flutter is another such cross-platform framework with which you can build apps that work on many different platforms, including web and mobile. However, Flutter uses the programming language Dart, which is less popular than JavaScript, Kotlin, or Swift.

I Want to Build Desktop Apps

When it comes to writing desktop applications for Windows, Mac, and Linux, the number of available choices is huge. Because desktop computers have been around for so long, many languages and frameworks evolved to write programs for them.

If you want to use a cross-platform solution, you can write apps for all three operating systems using a JavaScript framework called Electron. Electron allows you to build desktop apps like you would build a website: with JavaScript, HTML, and CSS. That's what both Slack and WhatsApp, for instance, were built with.

Java (not JavaScript) is another popular language to write programs that work on all major operating systems. Java has been around for over 25 years and was one of the earliest languages to provide cross-platform support by running on top of a virtual machine that has compatible versions for many different platforms and operating systems available. And anywhere you can run Java, you can also use a more modern descendant of Java that runs on the same virtual machine, like Kotlin. However, while macOS has a Java runtime available, there is none for iPhones so they can't run apps built with Java.

As usual, the price you pay for cross-platform support is a less performant app with subpar integration with the operating system. If you want to target only a specific OS, it makes sense to pick the language with the best platform support.

Windows

Learn: C#/.NET

A great language to build apps specifically for Windows is C# together with the .NET software framework.

.NET is actually also a cross-platform framework that enables your program to run pretty much anywhere. In fact, it's what the Unity game engine uses under the hood to make its games available on many different devices. However, the biggest strength of .NET is Windows development. That's because both C# and .NET were created by Microsoft who endowed them with great integration for their operating system.

As mentioned in the paragraph about game development, C# is considered a beginner-friendly language and .NET has several powerful UI frameworks available, like WPF, with which you can render graphical user interfaces in your Windows programs.

Again, this is just a guideline. Other languages might be better choices depending on your use case. Very performance-critical apps, for instance, might require you to pick a lower-level language like C or C++ instead.

Mac

Learn: Swift

Although you can build macOS apps using C# with .NET, or any of the many other cross-platform frameworks, if you want to build apps specifically for macOS, Swift is your best choice. The same as on iOS and the other Apple operating systems, Swift is used to build native apps for macOS. This means that you get full access to all the OS's features together with great performance.

Swift also comes with a modern UI library called SwiftUI. It's a so-called declarative UI framework, which is a technology that's also used in React and Android's Jetpack Compose. Declarative UI makes building bug-free user interfaces easier than the older, imperative coding style we were using before.

Linux

Learn: C++/Qt

If you want to build desktop apps with graphical user interfaces for Linux, the Qt framework is a popular choice. Similar to .NET which I mentioned in the Windows section, Qt is a cross-platform framework that provides libraries and tools to make your program run on different operating systems. It can be used with a variety of programming languages, but the most popular choice is C++.

While you can build Linux apps with C# and .NET as well, the support is not as great as it is for Windows development.

Again, C++ is a more difficult language to learn but if you're a Linux user, you're probably a powernerd anyway.

I Want to Get Into Data Science or Machine Learning

Learn: Python

Python is a popular language of choice for working with and visualizing data, as well as machine learning, because it has many powerful libraries available that deal with those tasks. Python's very readable, beginner-friendly syntax makes the language easy to learn and lets you do a lot with few lines of code.

Another commonly used language for data science is R. However, because of Python's easier learning curve and the fact that you can do so much more with it, from building games to web servers, it's the more popular language of the two. In surveys, Python usually ranks in the top 3 most popular programming languages, far ahead of R, which can only be used for statistical analysis. Needless to say that the job market for Python is also much bigger.

Python is also often used for task automation. It has libraries available that let you do stuff like scraping websites, filling Excel sheets with data, and so on.

Conclusion

Now you should know what programming language to start with, depending on what kind of program you want to build. Remember, this is just a guideline. There are special cases where another language or framework is better suited, or maybe you just realize that you prefer working with a different language. Don't worry, after you've learned one programming language, and understand how to think about and work with code, learning additional languages is easy. So don't get stuck in analysis paralysis. Just pick a field that interests you, build something with it, and see how you like it.

One more tip:

After you've finished a beginner course, the best way to keep learning is by building real projects. I wrote another blog post where I explain why this is the best (and most fun) way to learn coding and keep improving your skills. Give it a read!

And then I wish you a lot of fun and happy coding! You got this!

Tip: I send regular high-quality web development content to my free email newsletter. It's a great way to improve your skills and stay ahead of the curve.

Subscribe Now

Check out these other posts: