The first programming language you should learn… A debate…

Nick Anthony
4 min readSep 17, 2020

JS v Python… the final showdown

*** EDIT: Read about my new revelations on this topic here. ***

At this point there can be no doubt if you are in the tech world you have heard of both of these popular languages. Maybe if you are just starting out you are wondering what the differences are and which one you should learn. My programming journey started three years ago and I remember searching extensively to find which language I should learn first. I was interesting in data analysis and so my choices were R or Python. I chose Python and have written it daily ever since. Your choice may not be so clear. There are hundreds of programming languages to choose from. So today I plan to answer the age-old question of: “What programming language should I learn first? (in 2020)”

Caveat: the first for reference here does not refer to existing programmers looking for transitions, but new programmers who have never written code before.

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.

Conclusion

In summary, I would recommend JS if you are interesting in building websites (either frontend or backend) and Python if you are interested in data, general-purpose programming, and some web development.

If you are feeling adventurous you should learn BOTH. My current preferred stack is to use Python for all of my data related tasks and database interactions and JavaScript to build my website. I use Python for software that I build and share as well as analysis and then, almost always, end up transitioning this software/analysis into an API (which is just a website that returns data at given URLs instead of web pages). I then combine this API with a JS frontend framework like React (or my current favorite, VueJS). I found my Django/Flask websites lacking core functionality utlizing only templates and Bootstrap styling. And now, having learned JS, can say I am very much enjoying being a full-stack developer and being able to work on a project from start to finish, end-to-end.

If you’ve made it this far I thank you!

Have a great day and be kind to yourself and others!

--

--