DEV Community

Cover image for Where to Start: Python or JavaScript?

Where to Start: Python or JavaScript?

Ben Halpern on April 04, 2023

Based on popularity and demand in the current job market, two of the top languages to learn first in coding today are: Python because it’s versat...
Collapse
 
leob profile image
leob

If you're aiming to get into web development? JavaScript - is it even a contest?

If you're aiming to get into data science? Python - is it even a contest?

P.S. you're not even mentioning PHP, which I think is much bigger than Python in web dev BACKEND development :)

Collapse
 
atinypixel profile image
Aziz Kaukawala • Edited

Indeed PHP is underrated!

I learnt basic Javascript for DOM manipulation in frontend projects and later on learnt PHP as a proper backend language and till date I use it (first few years with Wordpress & now Laravel). Surely now I work with many other languages such as python (Django), Nodejs, dart (flutter).

Point is, PHP is underrated and termed as "dying" even before I started to learn it. Still after 8 years people term is as "dying" but I know that's not gonna happen any sooner!

Happy Coding

Collapse
 
leob profile image
leob

I hope people saying that PHP is "dying" start checking their facts, and they'll see nothing is further from the truth ... modern PHP is a joy to use, especially with a framework like Laravel.

You can deploy a Laravel app on AWS Lambda (I've done it, it's surprisingly easy), and it scales like crazy. And PHP 7/8 is seriously fast as well ... and still evolving and improving (types and so on).

I'm definitely a fan :)

Thread Thread
 
atinypixel profile image
Aziz Kaukawala

Absolutely! 🔥
Image description

Thread Thread
 
leob profile image
leob

I know where PHP's reputation stems from - it's based on PHP as it was 10 or 15 years ago ... things have moved on, I think it's not that hard to understand :)

Thread Thread
 
insidewhy profile image
insidewhy

PHP is still kind of annoying to use though, for example the typechecking still occurs at runtime even when you annotate the types.

Things have improved but the language designers continue to make perplexing choices.

Collapse
 
frankfont profile image
Frank Font

Python is easier to learn and illustrates some fundamental concepts more cleanly than Javascript.

I'd suggest kids get introduced to CS concepts using Python but then when it is time for a job -- make sure you learn Javascript. That stuff is everywhere.

Collapse
 
vulcanwm profile image
Medea

I personally prefer starting with Python.
I started coding with Python, and I found it really helpful.
I learnt basic techniques like variables, loops and functions.
Now I'm learning JS, and it's been very easy to migrate.

Collapse
 
bad_request400 profile image
Bad Request 400

I would second that. In my intern years i had to start in C then C++.
Later on i teached myself a bit of java. But coding never "clicked" for me in the sense that i never wanted to code or had any fun with it.

Python was the first language i looked at (for a project back 7 or 8 years ago) that when i started to get the hang of it i had fun coding. I cannot tell you how important that moment was for my professional life.

Having fun coding and solving problems was what got me my current job which i love (not like, but love).

No matter whats choosen. When you start coding and its your first language having fun with it is the most important thing.

There are many reasons a lot smater ppl could come up with but for me its the following:

  • If you learn new things its hard, coding is hard
  • Coding cant be learned by reading but only by practicing (im partial to project based learning)

Funny enough having some ancient background knowledge i was forced to learn with C (like how a programms works fundamentally) has come handy more often than not. So take what im saying with a grain of salt.

so long

Collapse
 
andrewbaisden profile image
Andrew Baisden

I would start with learning JavaScript because the community is so big and active so finding help is incredibly easy. And its a versatile language you can build web, mobile, desktop, and machine learning apps. Both frontend and backend giving you infinite job opportunities across the techbnical stack.

Learning Python should be a must as well though if you know them both then you are not going to run out of job opportunities.

Collapse
 
max24816 profile image
Max

The choice of which tech skills to learn depends on both your personal interests and the demand for those skills in your local job market. If you are just starting out, I would recommend starting with Python. However, as your career progresses, you may need to learn multiple tech stacks, such as React for frontend development and Django for backend development.

Collapse
 
eerk profile image
eerk

For me it would always be Javascript because it's so much easier to visualise and share your work. In python you will learn abstract concepts, but it's super unclear how you can build something other than console.log to see the results of your work.

Mini-rant:
Installing python is a nightmare beyond belief, your whole system gets littered with different versions in different install locations, unless you learn first how to create virtual environments in the terminal. Even tools like anaconda still don't fully solve this problem.

Collapse
 
bmraubo profile image
Bartosz Raubo

I don't think you're going to be disadvantaged by either choice, although if you set out learning a programming language with a general fascination with frontend work, then JS would be the obvious choice.

If you are just learning programming for the hell of it - with no real plan or direction for what you might use it for in the future - then I would pick Python, mainly due to Jupyter notebooks being such a valuable tool for experimentation and seeing the effect of your code line by line.

Collapse
 
lionelrowe profile image
lionel-rowe

Observable gives a similar interface to Jupyter but with JS, and the code runs directly in the browser, so there's zero network latency (except for things like async data fetching). Each cell also updates automatically based on its dependencies, so you get instant visual feedback across all cells.

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer

Might be odd to favor C-style languages with their curly braces and semicolons and everything, as a German, when those braces, colons and single quotes are surprisingly hard to type on a German keyboard! When I started long ago with BASIC, there was none of that, just 20 IF A$>1 THEN GOTO 10
We even had to type end edit the line numbers!
But have you ever tried to read and write python or any other indentation based syntax on a small screen? Personally, I'm not a great fan of Python. But I still think it's a very good, and useful, and beginner-friendly language. And there is a lot to criticize about JavaScript, even about ES2023, so, yes, I will vote that everyone starts to learn Python!

Collapse
 
satriopamungkas profile image
Muhammad Raihan Satrio Putra Pamungkas

Based on my previous experience teaching coding to several peoples from different backgrounds in a community bootcamp. I've taught both languages on different occasions.

In my opinion, using Python as a first programming language is a better approach for general people as it's much easier to understand and has a straightforward syntax. On the other hand, JavaScript is also beginner-friendly, but it has broader knowledge prerequisites.

For instance, we need to understand some basic web concepts since JavaScript is attached and executed directly in the browser. Even though we can use NodeJS to execute the code in our terminal, it can be more challenging to explain the concept related to JavaScript and web browsers to people without an additional IT background.

Collapse
 
owentechke profile image
Abraham Gumba

Exactly! I'm surprised many people are missing this fact - Javascript requires some prior knowledge. Python can start from zero.

Collapse
 
jimmymcbride profile image
Jimmy McBride

I think there's no one size fits all answer here. Check both out, see what they have to offer and choose the one YOU like, not the one that someone else tells you, you should learn. Once you learn your first language, all languages come so much easier after that.

I think making the choice based off of what you want to do will lead to sticking with coding more than making a choice based off of what someone else says is best.

Personally if I had to start from scratch and relearn everything, I know that I like frameworks like React and Vue, and building back end api's and making web apps/services, and the full stack experience. So I'd go JavaScript. But you can do all the same things Python using things like Django and Flask and especially if you like hard core web scraping, data science, machine learning and building services based off those kind of things, Python will serve you better.

Which sounds better to YOU? I know what sounds better to me.

Collapse
 
tfantina profile image
Travis Fantina

I'd argue that the best first language is the one you enjoy. If you spend a few days in Javascript land and it's not your jam try out Python, try Ruby try PHP whatever. Learning something you enjoy is a lot easier than trying to force yourself to learn something based on what you predict the job market will want. Programming is about solving problems, the skills of debugging, problem solving, algorithms, and breaking down a complex system into manageable parts will transfer from language to language.

Collapse
 
bustersenior profile image
Buster Senior

Python
Pros:

  • It's very easy compared to other languages
  • It sets you up for doing stuff with data and backend development
  • It's can be used for almost anything Cons:
  • It's slow
  • It can be so easy it makes other languages seem hard
  • Many people hate it's use of colons

Javascript
Pros:

  • It's has many libraries and frameworks
  • It's fast
  • It's can be used for almost anything Cons:
  • It can be overwhelming learning it's frameworks
  • It's harder then Python
  • Some people disable it on there web browsers

I would suggest learning them on Free Code Camo

Collapse
 
bybydev profile image
byby.dev

If you are interested in data analysis, scientific computing, or machine learning, Python may be the better choice. If you want to focus on web development, JavaScript is the way to go. However, both languages are useful and widely used in different industries, so learning both can be beneficial.

Collapse
 
wizdomtek profile image
Christopher Glikpo ⭐

Deciding whether to start with Python or JavaScript depends on your goals and what you want to accomplish. Both Python and JavaScript are popular programming languages, and they have their strengths and weaknesses.

Python is a popular language for data science, machine learning, and artificial intelligence. It has a simple syntax and is easy to learn. Python is often used for scripting and automation, and it's widely used in scientific computing and data analysis. If your goal is to work with data or build machine learning models, Python might be the better choice.

On the other hand, JavaScript is a language used for web development. It's used for creating dynamic web pages, interactive user interfaces, and web applications. JavaScript is also used for server-side programming, mobile app development, and game development. If you're interested in web development, JavaScript might be the better choice.

In summary, if you're interested in data science, machine learning, and scientific computing, you might want to start with Python. If you're interested in web development, mobile app development, or game development, you might want to start with JavaScript. However, both languages are valuable skills to have in today's job market, so it's a good idea to learn both eventually.

Collapse
 
c0mmand3rj profile image
James Batista

Both Python and JavaScript have their strengths and weaknesses, and the choice ultimately depends on what you want to do and where you want to start in your career. I'd say Javascript would be the fist thing to learn. Its everywhere and continuing to grow. Python would be my secondary choice to learn after. They are both widely used in the industry.

Collapse
 
cyblance profile image
Cyblance

the basic is javascript so go with java script.