DEV Community

Cover image for Where to Start: Python or JavaScript?
Ben Halpern Subscriber for CodeNewbie

Posted on • Edited on

Where to Start: Python or JavaScript?

Based on popularity and demand in the current job market, two of the top languages to learn first in coding today are:

  1. Python because it’s versatile and easy-to-learn, as well as widely used in data science, machine learning, web development, and automation. It has a simple syntax and a large community of developers, so it’s an accessible language for beginners.
  2. JavaScript, especially for front-end (and now popular for back-end) web development, is also quite versatile and scalable. It's used to build interactive websites and web applications, and it has a large number of libraries and frameworks available for developers to use.

Both Python and JavaScript are used in a variety of industries, so learning these languages can provide a solid foundation for further exploration in programming and open up a wide range of career opportunities.

Where do you recommend our CodeNewbies to start? With one of these languages, or perhaps another? Share your experience!

Latest comments (31)

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
 
cyblance profile image
Cyblance

the basic is javascript so go with java script.

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
 
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
 
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
 
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
 
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.

Thread Thread
 
leob profile image
leob

Perplexing choices, which ones, apart from the type stuff? The type annotations do help a lot within an IDE like VSCode.

Thread Thread
 
insidewhy profile image
insidewhy

For example I can refer to a constant like THIS so the parser is clearly able to understand bare words in variable context, yet, despite variables being far more common, I must prefix them with $. So the code is littered with $ symbols that basically seem redundant.

Thread Thread
 
leob profile image
leob

LOL okay ... well in PHP variables simply must start with a $, it's rule #1 - the code is neither "littered" nor is it redundant - it's simply how the language is defined, nobody would even contemplate to ever change this.

I like the language, especially with a modern framework like Laravel - if you don't like it, don't use it.

I've looked briefly at Python and I didn't like its syntax (indentation and so on). Also worked a bit with Ruby (Rails) and yes, it's elegant and concise, but it tries to be too clever sometimes, it can lead to terse and hard to comprehend code. Javascript on the server is okay, but it's a nuisance that everything's asynchronous. And I've also used Java, but it's too verbose, and people who program in it insist on over-engineering everything.

What do I want to say with all this? For me, compared to the other languages that I mentioned, PHP strikes a good balance between being not too verbose, but also not too terse - it promotes writing code that's easy to read (you know, code is written once, but read dozens of times).

Thread Thread
 
insidewhy profile image
insidewhy • Edited

Um "That's just how it is, it's not littered or redundant". Not such a great counterpoint.

I like pretty much any language more than PHP, it's an ill-advised poorly designed mess, which explains why it's so commonly hated and pays much less than any other language at its popularity level.

Laravel is okay I guess, but I'd still rather listen to Lighthouse Family than use it, and I really hate Lighthouse Family.

Thread Thread
 
leob profile image
leob • Edited

I just meant to say they're not gonna change this, because it's not realistic - it would be too disruptive, it would lead to half the documentation becoming instantly outdated, and it would lead to highly inconsistent code bases (one dev wants to use $, the other doesn't) - that's why it's not gonna happen, it's just a matter of common sense.

I think that's plenty good enough as a "counterpoint".

it's an ill-advised poorly designed mess, which explains why it's so commonly hated and pays much less than any other language at its popularity level

LOL all of this is 100% subjective (and pretty extreme) - and you're telling me that I have weak arguments :-D

"Pays less", my hat ... in my world the rate that I get paid depends on entirely different factors.

For me it's just a tool that works ... like I said, if you don't want to use it, then just don't use it, simple as that.

Thread Thread
 
insidewhy profile image
insidewhy

Many of the design choices are objectively poor. The associativity of the ternary operator, the type system, ideas it inherited from perl, another language that famously died. If you compare php salaries to typescript, rust, go, python, the median/mean is much less. I don't like go either but it just shows the general animosity towards php, the same animosity overwhelmingly felt by most developers and for good reason.

All programming languages "work" so it's a pretty low bar.

Thread Thread
 
leob profile image
leob • Edited

I agree that some design choices are poor, but the language is old, and most of those choices stem from the ancient beginning years of the language. They've been modernizing the language systematically, and you can simply ignore 99% of the old cruft. Is it any different with JavaScript? Also many poor and confusing "legacy" choices there, but you can just ignore them and use "the good parts" (maybe you've heard about that book).

Well and I'm not an employee, I'm a freelancer/contractor, so "median salary" is irrelevant to me. Customer wants a site, app or platform with certain functionality, we agree on a price, then I build it - in most cases they don't care about the technology (but, Laravel is hugely popular for web projects, has been growing like weed).

I can develop an application locally in Laravel, then with one terminal command I can deploy it to AWS Lambda and it scales like crazy, without changing one single line of application code (only config variables). I know it because I've done it. Hugely powerful, can any of your supposedly superior languages do that too?

"the same animosity overwhelmingly felt by most developers and for good reason"

There we go again, a highly emotional argument which is 100% subjective ("general animosity", "overwhelmingly felt" and "for good reason"). I can't begin to tell you how comical it is, I had a good chuckle.

Can you back up your claim with statistics? Maybe most of those devs have at some point been forced to work on WordPress sites and yes, then I can imagine that they hated PHP, because WordPress sucks, it's old spaghetti garbage. Their opinion would probably be different if they'd had to work on a well-structured codebase created with Laravel or a similar framework.

Long story short, your assumptions and opinions are mostly based on ancient and outdated facts, and on a huge amount of bias.

P.S. could be me, but I also fail to see what's the purpose of these pseudo-religious battles, where people need to go around discussion forums on the internet, declaring "my language is better than yours", and denigrating another language and their users. Last time I'm saying it: you don't like it, you don't use it - other people like it so they use it, it's called "freedom of choice".

I think we should leave it at that, I've said everything I had to say, and I don't want to be repeating myself.

Have a nice day!

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
 
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
 
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