The first programming language you should learn… A debate…
By: Nick Anthony
Tags: Programming, JavaScript, Data Science, Python, Web Development

Set the Stage

Both JavaScript and Python offer a wide range of features and have extensive, amazing communities behind them. We are going to delve into the technical and professional aspects of both languages while avoiding some of lower-level technical details. In doing so, I hope to paint a picture of which language you should choose based on your preferences and personality. We will compare these languages on only two key aspects: learning curve and utility/use-cases.

1. Learning Curve

JS and Python both have low learning curves and are quite easy to pick up on. Both are dynamically typed which helps beginners tremendously. Python is currently embracing type hints, but these are not enforced and runtime. Similarly, JS has a language subset called TypeScript which enforces types on all objects but JS itself does not. Speaking of, both languages follow OOP principles which is another plus for learning since objects are a great way to relate abstract coding structures to real-life structures.

One downside to Python is that it requires installation and Python versions change relatively frequently. Managing Python versions is a known headache for any Python dev, but there are many packages out there to help combat this issue including conda, poetry, and virtualenv. In order to run Python scripts you either need to utilize Jupyter Notebooks (which require installation) or utilize a terminal and code editor to write code (yes these could be the same via vim/nano). The Anaconda installation does install VS Code, Jupyter Notebook, Python all at once for users and is available on all platforms.

JS, on the other hand, can be written directly in your browser simply by navigating to the Chrome Developer Tools. This makes it very user friendly since you can actually just code in your browser and see the changes directly happen on a web page. No installation required. This principle does break down once you start installing node packages and using frontend frameworks, but for Vanilla JS, it couldn’t be easier to get started.

As far as syntax goes, both languages are simple to understand and get used to and any code editor provides great support for both. Arguments could be made for Python over JS on the syntax front, but I think they are simply different and that, with editor support, neither would provide a large hinderance to getting starting. On second thought, I would select Python here due to ignoring curly braces and no semi-colons despite its whitespace issues. Especially considering that advanced frontend frameworks like the popular React library or Angular utilize ES6 syntax which can be quite confusing at times.

2. Utility / Use Cases

The use cases for these languages are where they really differ. This also bleads into job prospects. Python is excellent for data analysis, data engineering, data science, one-off scripts, automation, machine learning, and backend web development. Javascript is excellent at nearly everything on the web from frontend styling and animation to backend frameworks and interacting with databases.

The simplest way I can explain the difference here is this: Python works many places, JS works on the web only. If you want to build on the web only, the choice is easy: JS. If you want to build small games, desktop apps, software, or do data related tasks, choose Python.

Interestingly, Python can do some of the things JS can do regarding web development backend. In fact, Python’s two most popular web frameworks Django and Flask run many popular web backends. JS has its own backend frameworks including Express.