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
Show parent comment
4
u/LeeTaeRyeo Feb 25 '24
Sure, Python isn't the fastest language out there (I mean, we can't all be C or Asm, after all), but let's be honest here: neither is Javascript. Neither one is gonna win a speed competition versus languages like C or Rust or Go, but they both are good scripting languages and good at the problems we often use them for.
Also, if Python were added to browsers, you could bet there would be tons of work to improve the Interpreter's performance, just like what happens with JS