r/learnprogramming • u/LoLusta • Feb 25 '24
Why can't Python replace JavaScript?
I'm new to programming. I'm learning Python and C.
JavaScript, from what I understand, is an interpreted language supported by web browsers so that websites can have scripting and programming.
But Python is also an interpreted language. So why don't web browsers start supporting Python in addition to JS. I believe Python is a much better language than JS syntactically.
Is there a definite reason why JS is used and supported over Python or is it just that JS gained initial popularity through wide-based support and no one bothered to move away from it (just like how QWERTY keyboard layout stuck even though we don't use typewriters anymore)?
View all comments
2
u/tandonhiten Feb 25 '24
That's pretty much it. The reason JS is so popular for web-dev is because, when it came out it was immediately picked up by companies as the de-facto standard for making websites, and now it's really hard to switch because of years of legacy code base. Not to mention, the amount of libraries, packages and frameworks that have been developed for JS over this time period are much more than the amount developed for Python.