DEV Community

loading...
Cover image for Why JavaScript not Python for Web Development?

Why JavaScript not Python for Web Development?

Atul Bhatt
React JS with REDUX @SheThink | Blogger | Infosys Certified Systems Engineer
・3 min read

PS: Web Development term here primarily concentrated on Frontend Development.

So today one of my friend asked me how to start web development in python❔

And I told him about Flask and Django because those are the one I have heard of and kinda actually tried.

But then I ❓ him for whom he is asking this for?

He replied for one of his friend.

Then I quickly asked him why didn't he suggest him to try JavaScript for that. (He himself is a React Native developer)

He said that this friend of his knows Python and he just 💕 it.

So in short his friend is in 💕 with Python and we all know that Love makes you blind🙈.

So my friends, this article is an attempt to save so many friends like this from being in 💕 with a language so much that they would try to do everything possible with that language only.

Most of these people are college or university students. I mean it's not wrong to learn python and do development with it. But what I'm giving here is a single advice with list✔️ of reasons that you surely need in your college times.

wanted

This above image is from 2020 Developer Survey by StackOverflow.
Python is the most wanted language. But who is the second one?
developer survey 2020

So in between I'll be throwing more images from 2020 Developer Survey by StackOverflow. Don't ignore🤷‍♂️ them.

🙊 Secret 🙊: I was also badly but not 🙈 in love with python, and TypeScript is secretly🤐 JavaScript.

⚠️Warning⚠️: This article is not at all about Why Python for Web Development not JavaScript? However, I would be glad😊 to read if you have some points on it. So don't hesitate to comment them 👇.

Now let's jump🦘 into the Reasons:

1.Jobs, Jobs, Jobs 💲💲💹.

Majority of the people in this category are college students. And when it comes for the time of getting jobs you won't find as many Job in Web Development through Python as many you would get being a developer using a JS library.
See for yourself who is the king.

most popular

2.Learning Curve

As a developer who was always in awe with how easy and cool is Python. Believe me. JavaScript is not at all disappointing. You may find it even cooler😎.
And don't you worry, JavaScript won't ask you to put that Semi-colon ;

3.Web runs on browsers🌐.

So if you are thinking of web development as your future then you shouldn't forget the fundamentals of Web. Web browser understands JavaScript. They don't❌ understand any other languages and that's a full stop🛑.
In simple words you can't escape learning JavaScript.
And don't make me mention that, "Everyone use web browsers to access the web." Oops!😅 I did it.
Does that OOPS reminds you of something. Nevermind.

4.Be Choosy.

When I ask someone about doing web development in Python, the only terms I get to hear are Flask and Django and TBH now I don't get to hear it all🙄.
You can choose so many good frameworks and library in JavaScript that are so good in what they do, that it will become difficult for you to decide which one to choose🤯.
And if you're confused then stackoverflow survey can give you a hint💡.

race web dev

Bonus point: You can even do backend with JavaScript. Node JS is there waiting for you to try it out.-

5.From Web🌐 to Mobile📱.

You can even get into Native Mobile app development via JS using React Native. And not just Gimmicky mobile app development but a proper one.

Below is the link to the sources of my Screenshot:
StackOverflow 2020 Survey

I hope you enjoyed🍿 reading this article. This article is my personal🙍 opinion but a strong one with facts and figures. I don't hate python but it's just that I moved on. It was hard😓 but I did.
We should treat languages like Crushes not life partners😜. Shower some love if you read it till end. And share it with someone who really need to read this.

Discussion (31)

Collapse
hanpari profile image
Pavel Morava • Edited

To prefer Python over Javascript is not a question of being blind by love.

I would rather say that prefer Javascript over Python is just a question of ignorance.

Seriously not, Javascript is a flawed minefield, and no JS iterations corrected that and probably never will.

Why do you think there is do many attempts to avoid or improve JavaScript? CoffeeScript, Typescript, KotlinJS, and so many others?

Is it because Javascript is so good or so bad?

I think the answer is not that hard.

Collapse
mohitdubey037 profile image
mohit dubey

He is just put his own opinion..it should depend on individual to select a particular language, but not to stick with that thats why he has used the word love. He has also used the global survery conducted by stackoverflow for better understanding.So it bit impressed by the article

Collapse
hanpari profile image
Pavel Morava

We both expressed our opinions. As for promoting Javascript over Python, I was talking about ignorance if I recall correctly.

I was referring to the well-known fact of Javascript being pretty badly designed, which should be no surprise to anyone who knows its origin.

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

Thanks 😊

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

I wasn't mentioning preferring Python over JavaScript as being blind by love. I meant that he is just looking at python but ignoring the improvements JavaScript had gone through. But I would say I should have been more clear on this.

Javascript without doubt is the most dreaded language. But I can bet on it being the best for Web Development.

Collapse
hanpari profile image
Pavel Morava

It is the only way how to script browser unless we count webassembly.

It is not surprising to be best when there is no competition. But the point of the article was to dissuade someone from using Python in favor of Javascript for backend, at least as much I would deduce from mentioning Django or Flask.

Thread Thread
atulbhattsystem32 profile image
Atul Bhatt Author

I will make things more clear in this article by making some edits. I'm extremely sorry if this is what it portrayed.

Thread Thread
hanpari profile image
Pavel Morava

Nothing to be extremely sorry 😉

You are not first one with the similar point of view.

Collapse
sudarshansb143 profile image
Sudarshan Sawandkar

This is great.

Although, many people says that javascript is the language of web.

but, when it comes to things like multi threading , CPU intensive task excution and many more heavy lifting stuff, then javascript is no way near to (giant) PYTHON

Collapse
kdenehy profile image
Kelly R Denehy

Your comment is probably 5 years out of date.

Google "javascript performance vs. python" and you'll find numerous benchmarks showing javascript faster, sometimes MUCH faster, for most of them.

Javascript has supported multi-threading for quite a while. "Web Workers" are available in both the front and back ends, and there are several language constructs for performing asynchronous operations.

But if you love python, by all means use it for the backend, preferably for providing REST services.

Collapse
sharpninja profile image
The Sharp Ninja

No. Full stop. NodeJS is many times faster than Python. Go look at the Tech Empower benchmarks.

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

My focus was on frontend web development in this post. Backend maybe another time.

Thread Thread
sharpninja profile image
The Sharp Ninja

Yes, even then Python is a non-starter unless you port python.exe to WASM.

Collapse
gdledsan profile image
Mundo • Edited

So, some backedn languages do have libraries to write front end, like python to JS or ruby to JS compilers.

You could also skip that and go for webassembly with rust.

I have nothing against vanilla JS for front end, even jQuery or other similar libraries or frameworks that make your life easier mostly because JS is not good enough.

But anything beyond that is annoying, new libraries that requiere node just to install them and have no cdn version to just use them in the front are the sign JS should have stopped years ago.

Anyone starting in front end should not need node or deno for anything, and should definitely not start with the likes of angular, react or vue.

Bottom line, you are mostly wrong on all points by failing to mention that there are ways to skip JS all togheter and still achieve things in the front.

Btw, you seem awfully biased towards JS to be written about not being biased against it.

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

I agree I was biased towards JS because it is better to learn JS in comparison to python when someone is starting with web development.

Python is good and I don't deny it. And I also agree to JS being the most dreaded language.

This article was written keeping the college students in mind who learn python and try to achieve everything with it.

This article is not about why always use JavaScript.

Collapse
narasimha1997 profile image
Narasimha Prasanna HN

Since you are talking about web development, one must not use Python (if not backend rendering). JavaScript is of course De-Facto. So this comparison would have made much sense if it was comparison between JavaScript v/s Rust (Web assembly). Coming to Web servers, I would prefer Python or JavaScript based on the need. For example, if I want to run AI inference I would prefer Python more than JavaScript. If it is just a normal web server which just does some calls to DB or other backends, I would prefer JavaScript.

JavaScript has much better performance when compared to Python - But this is dependant on the application. If you use JavaScript for image processing for example, it would be not useful, because we have many libraries for Python written in C/C++ that can take good performance gain. If my application is purely IO based, I would happily choose JavaScript (node.js) because we can use Node.js powerful event loop and asynchronous processing.

For frontend I would prefer more of Web assembly if I need high performance.

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

I made this comparison because college students learn python and then try to do everything with it. Rust is language that's still alien to them. Majority of the college students.

This comparison is done intentionally for those college students trying to do everything with python front frontend, backend to mobile app development.

There are so many things python is good at and I won't deny that. I myself prefee python for scripting because of its easy syntax and plethora of modules and libraries available.
😊

Collapse
leewynne profile image
Lee Wynne • Edited

Nice post 👍

Worth clarification though on frontend / backend. For backend I feel like there is no real justification for using JS if you don’t want to or if you have a use case for something else like Python / Ruby etc.

If this article is front end focused then it’s a conversation about JS frameworks v vanilla JS again.

If this article is fullstack focused then again the conversation is very different depending on the required outcome.

One thing I do agree on. Learning vanilla JS for browser/dom manipulation is 💯 worth investing time in. Learning Node for backend, not so sure, there are many beautiful options for that full stack story.

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

This was written keeping in mind that someone who is beginner with knowledge of python and just entering into the web development should prefer JS over python.
The reasons are the one I mentioned.
The college students get to know python in college and try to do every possible thing with it.

And the fact you can always move towards optimization and better things once you have stepped in.

In the end tech stack becomes secondary with experience. The knowledge to implement things become the primary goal.
And yes, it's written keeping the Frontend in mind.
Thank you for your feedback😀

Collapse
calypso_eo profile image
PETERS • Edited

"Web runs on browsers" yes but that's a client, doesn't really have anything to do with not learning Javascript over Python but instead learning it alongside it. Browsers don't care about your backend implementations hence the use of frameworks like Django and Flask. You can run React and Django simultaneously so you don't necessarily need to pick one or the other. I always encourage people to learn using their favorite languages first. Language and frameworks are just tools, you pick the best tool to complete a job and on to the next, no need to revolve our personalities around them.

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author • Edited

True. That's what the last line says. Treat languages like crushes not life partners.

Collapse
bubster profile image
TvO

god the emojis.

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

Ooops ... they are too much. Just wanted to make it feel more like a conversation.

Collapse
hadar759 profile image
Hadar Dagan

Don't worry my friend the emojis are the best part! I had a great time reading your wonderful article ❤

Thread Thread
atulbhattsystem32 profile image
Atul Bhatt Author

Thanks ❤️❤️❤️
I'm glad you enjoyed reading this one.

Collapse
aakatev profile image
Artem

there is only one language running in browser

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

Ahmmm

Collapse
anadi9 profile image
Anadi Thakur • Edited

Very well explained i also shared it with my few friends to convince them on this topic.

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

Thanks 😊

Collapse
khaledeev profile image
Khalid Mesbah • Edited

Great content mate, just asking I mean If I preferred PHP/Laravel over JavaScript means I'm being blind by love?
(I know the post about Python-JS)

Collapse
atulbhattsystem32 profile image
Atul Bhatt Author

This article is mainly focused on someone who is starting to dive into the world of Web-Dev and not someone who is already into it.

If you already doing great in one you can easily switch to other. But this article focuses on someone who really just knows the language but not the web development.

Being blind by love means: trying to do all the tasks with the one language you enjoy coding with or primarily code with
I hope you got the point. So with this you can easily understand if you are blinded by love or not.

And thanks for your time reading it. 😉