DEV Community

Cover image for Which programming language should I learn first?
Hunter Johnson for Educative

Posted on

Which programming language should I learn first?

I’m Fahim, a software developer turned tech founder. This article is part of my series: The Developer’s Launchpad. I’ll share my top lessons, hacks, and best practices for learning how to code and launching a new career — things I wish I would’ve known earlier in my journey. If you’re starting out your own coding journey, this series is for you.

When new coders ask me the question, “Which programming language should I learn first?” I often think about Coke vs. Pepsi.

The debate between Coca-Cola and Pepsi is alive and well. Everyone has their own personal preference, and there’s no “objectively correct” answer.

Similarly, when it comes to the best first programming language, individual preferences usually precede facts.

At the end of the day, human beings are different. Many successful developers might tell you to start with JavaScript, while tons of brilliant programmers swear by Python. Meanwhile, plenty others might advocate for Java, C++, or Ruby, just to name a few.

I’m not here to tell you which language is right for you — although in this article I will share pros and cons for a few popular options, so you can make a more educated choice.

But what I can tell you is this: Once you get the hang of basic problem-solving and coding in one language, you will have the right foundation to learn many more languages down the road.

So, let's get into the pros and cons of three popular languages:

  1. Python
  2. JavaScript
  3. Java

Pros and Cons of Popular Programming Languages

I will dive into each language later, but to start, here’s a table breaking down the key differences between three popular languages:

Python vs. JavaScript vs. Java

Python as your first Programming Language

Within the last several years, Python has replaced JavaScript as the world’s most popular programming language. Therefore most new learners probably gravitate towards Python as their first language.

Python is a great choice for beginners because it’s relatively simple, yet powerful enough to build planet-scale applications supporting billions of users. It’s a higher-level language than C/C++ and Java, so things are more abstracted (i.e. it hides a lot of underlying complexity, making it easier for humans to read) — without losing much power. Best of all, it’s pretty intuitive to get started in Python.

If you aspire to become a Data Scientist, Python is the strongest option. One of the best things about Python is that it comes with tons of open source libraries that can help you use Python in tons of different situations, from Machine Learning to natural sciences.

However, Python is only my second choice if you are interested in web development — especially front-end web development (more on that next).

Here's a link to get started with Python.

JavaScript as your first Programming Language

If Python is not spicy enough for your tastebuds, I recommend using JavaScript.

JavaScript is the programming language that is powering most websites today. If you are planning to build websites, pick JavaScript. Most web developers use JavaScript, along with HTML and CSS. This is essentially how you make and design webpages.

Here's a quick example: If you want a button on your webpage, you would use HTML to create that button. If you're going to color that button, you should use CSS. But when it comes to the actual action that needs to happen when you click the button, that's JavaScript.

You may have also heard from someone that you should learn React or Angular. These web development technologies are actually built on JavaScript.

JavaScript is super abstracted, meaning that it is very easy for humans to read. Unfortunately some of its abstractions are difficult to reconcile when you start working with other programming languages in the future, but that's a discussion for another day. You can go a long way just by learning JavaScript.

Get started with JavaScript here.

Java as your first Programming language

If you are in school for Computer Science, chances are that the first programming language you will encounter will be Java.

Despite the similarity in naming, Java and JavaScript are actually two distinct languages with very different use cases.

Java is a great overall language and focuses on the Object-Oriented Programming paradigm (something that you don’t need to worry about right now). The interesting thing is that in the first phase of your coding journey, you won’t need to use any object-oriented design principles, so learning Java would look pretty much the same as any other programming language — except for one key difference: Java is a typed programming language.

This means that you have to tell the type of each data that you use before using it. For example, you would have to tell the Java compiler if a certain data is a number or a string before you use it. That’s different from Python or JavaScript, which can infer the type of the data from the data itself.

You can start learning Java here.

And the winner is...

If you have read to this point, you already know that there is no winner. We’re back in Coke vs. Pepsi territory. The answer is totally subjective, and depends on your personality and career goals.

But if you had to pick one, which one should it be?

If you are looking for a quick overall winner, go with Python. (That's coming from someone who learned programming with C and still swears it's the best language to learn coding). If you are ready to test the waters, you can get your feet wet with a free Python course.

That said, no matter which language you start with, here is the most important thing to remember:

Mastering the foundations of one language will enable you to more easily learn other languages down the road.

That’s why if you invest the time to properly learn your computer science fundamentals, it will enable you to learn any programming language in the future. In this sense, it doesn’t matter that much which language you learn first. The most important thing you can do when just starting out is to establish the right foundation.

This breakdown on the Educative blog explores several top programming languages, and might be a good resource for evaluating which is best for you.

More from The Developer's Launchpad:

Top comments (4)

bcostaaa01 profile image

Might be a bit biased, but I really love Python. I find the syntax to be much simpler than JavaScript, at least for people just getting started. It is pretty much “what you see, is what you get”. JavaScript may be more “widespread” in terms of web frameworks, if you want to get into web development, but this doesn’t necessarily mean you can’t build web applications with Python 🙃 I don’t think Java is a good option for beginners, in my opinion, but it really depends on how much you invest into it, I guess, and how much you like the syntax or not. I do agree with you about learning the foundations. If you do learn them well, you can learn just about anything 👍

sreno77 profile image
Scott Reno

Pick the language that you're interested in. If you don't have a lot of interest, you won't get very far. Also you need the right tool for the job. If you want to learn web development, starting with C/C++ doesn't make much sense.

chemacortes profile image
Chema Cortés • Edited

You can see the programming language as a tool or as a discipline. If you just want a tool, use common languages such as python, java or javascript, with many examples and good documentation to get started. But to really learn to program you should start with languages that make you more disciplined, such as functional languages. Once you have acquired sufficient notions, it is easy to move on to other languages. Therefore, I would recommend starting with a functional programming language such as haskell, racket or scala.

artydev profile image

Perhaps, a way to choose one, is to imagine a project, the platform you will use or deploy it and then choose the appropriate language.
You project can be as minimalist as you want.