DEV Community

Cover image for JAVASCRIPT VS PYTHON
Sarthakux
Sarthakux

Posted on • Updated on

JAVASCRIPT VS PYTHON

Javascript and Python are arguably the two most popular languages today for programmers.
Let us compare the two respective programming languages.

  • Javascript is good for building a website or native applications whereas Python is good for data analytics,machine learning or math-intensive operations.
  • Javascript can be used to run on frontend whereas Python is on server-side or backend.
  • Python has procedural programming whereas Javascript does not have procedural programming.
  • Python is a better designed language which makes it easy to maintain whereas Javascript is poor.
  • Javascript is good for mobile development whereas Pyhton is not good for mobile development.
  • Javascript is faster to run as commpared to Python.
  • Javascript runs on both server side as well as on browser, whereas Python is mostly used for server side programming.
  • Unlike Javascript, Python does not have a way to inherit from instances.
  • Javascript only has floating point numbers whereas Python has different numeric types like int,float,fixed-point decimal,etc.
  • Javascript uses curly brackets whereas Python uses indentations.
  • Both these languages have their respective uses and in the end it all comes down to personal preferences.

Discussion (7)

Collapse
ogrotten profile image
ogrotten

The main difference between today's Python and JS is that Python growth was directed by A Guy (generally speaking), and JS growth was directed by it's community (generally speaking).

Therefore you get weird shit like no switch statement in python because, according to Van Rossum, the proposed syntax wouldn't save anything over just using a stack of thens. Even tho it was a popular proposal, and would clearly increase adoption for being a familiar element from other langs.

And there's other little shit like having array.pop() but no array.push(). Why would you do that?

Meantime, JS class syntax is the same scenario. It's nothing but additional syntax (syntactic sugar) with original JS prototypal inheritance at it's core. But the whole class syntax and structure was put into place specifically to bring JS more into line with programming languages in general.

Python could have been big shit, if not for a couple of huge mistakes... python2 vs python3 being the biggest, and a problem that will clearly never go away. JS faced it's own huge problems with NodeJS vs IO.js vs Ayo.js, but the group eventually worked things out and now it's as popular as ever with excellent direction.

Collapse
ogrotten profile image
ogrotten

While it's true, it's the same as saying that playing the game "super mario bros" is no different than sonic, because they're both just physical tests of how accurately you can push buttons in the order that a computer wants.

IOW you're missing the point. The high-level language has a use case for making the lower level accessible.

Collapse
tobiassn profile image
Tobias SN

Python is actually older than JS by about 5 years though.

Collapse
ogrotten profile image
ogrotten

Age has nothing to do with it. What he's saying is that deeep under the hood, they're doing the same things. . .

Thread Thread
tobiassn profile image
Tobias SN

Then it would have been better to say that the two are similar, rather than implying that one is a copy of the other.

Collapse
sarthakux profile image
Sarthakux Author

lol....You are a wise man sir. Thank you for checking the blog.