Which programming language should I learn first?
Tags: programming, python, javascript, java
Published: 2024-03-28 07:49:04

> 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2u6tgjjnozyamp81pti.png)

## 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**](https://www.educative.io/blog/how-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](https://www.educative.io/blog/python-libraries-for-data-science-and-machine-learning) to natural sciences.

However, Python is only my second choice if you are interested in web development — especially [front-end web development](https://www.educative.io/blog/roadmap-to-become-a-front-end-developer) (more on that next).

> Here's a link to [get started with Python](https://www.educative.io/python?utm_campaign=topic_python&utm_source=medium&utm_medium=text&utm_content=&utm_term=&eid=5082902844932096).

## 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](https://www.educative.io/blog/web-developer-skills) 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](https://www.educative.io/blog/angular-vs-react-javascript). 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](https://www.educative.io/blog/javascript-developer-roadmap). 

> [Get started with JavaScript here](https://www.educative.io/javascript?utm_campaign=learn_to_code&utm_source=medium&utm_medium=text&utm_content=&utm_term=&eid=5082902844932096).

## 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](https://www.educative.io/blog/java-vs-javascript) are actually two distinct languages with very different use cases.

Java is a great overall language and focuses on the [Object-Oriented Programming](https://www.educative.io/blog/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](https://www.educative.io/java?utm_campaign=learn_to_code&utm_source=medium&utm_medium=text&utm_content=&utm_term=&eid=5082902844932096).

## 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](https://www.educative.io/courses/learn-python-3-from-scratch?utm_campaign=topic_python&utm_source=medium&utm_medium=text&utm_content=&utm_term=&eid=5082902844932096).

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**](https://www.educative.io/blog/best-first-programming-language) explores several top programming languages, and might be a good resource for evaluating which is best for you.

## More from The Developer's Launchpad: 
* [5 things I wish I knew before I learned to code](https://www.educative.io/blog/things-i-wish-i-knew-before-learned-to-code)