Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 30, 2020 04:58 am GMT

Why I prefer JavaScript over Python

Over the years I've been using Python less and less. This has become more and more apparent as my GitHub and other websites I store code on have little to no Python on them anymore.

Performance

Don't get me wrong Python is a good language for small scripts and things but once it gets to larger projects, such as backends that will most likely be under heavy load, the interpreter starts becoming quite sluggish. An example of these kind of speed differences can be seen here.

Syntax

Another reason I personally tend to not use Python is I'm someone who started with languages like C++ at a early age, I'm more akin to languages with C-like syntax rather than ones with syntax like Python's as it feels weird, and finicky to me compared to say something like JavaScript which still uses brackets, semicolons, and other small syntactic details. As an example, something like the following:

function hello() {  console.log("hello world!");}hello();

personally feels a lot more grammatically correct in a way than something compared to python, with say how it defines functions:

def hello():  print("hello world!")hello()

Package Management

Now this one is going to be a bit of a "hot take". Node's package management is quite literally hell compared to Python's for a few reasons. One of these reasons is that instead of a central cache each project or repository uses, each project has their own instead of just reusing existing cached ones. This results in things taking up more space than need be, and overall the inclusion of libraries in libraries and those depending on libraries that are per-project is a mess.

Python's package management is a bit nicer as you don't exactly have a module folder per-project and rather you install the module or library "globally" for any project to use. This method is much cleaner and saves space and time as I don't need to redownload every library or package I need, if another project has already needed it in the past.

Last Words

Every language has their own pitfalls, however Python's when it comes to large scale projects are a bit too much for me, mainly regarding performance. Though In the end you should probably use another language (preferably one that's compiled) for a backend, especially one that will be under heavy load, to get the most performance and stability out of it.


Original Link: https://dev.to/hanna/why-i-prefer-javascript-over-python-1lnk

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To