Why JavaScript > Python for Beginners
Python is a very easy language to learn if you are a complete beginner to programming. Python offers a lot of tools to help speed up the development of your program. But while learning this, beginners start to think that all programming languages are like this. When in reality, most Python programming is black box1 programming. JavaScript offers a steeper learning curve than Python, but it’s very rewarding because it familiarizes you with almost any other mainstream language. You’ll have an easier time reading other programs written in different languages, smoother transition into other languages, and better overall problem-solving skills.
The syntax of JavaScript is more elegant and easier to read for any level of programmers. All blocks of code in JavaScript are always between two curly brackets, while Python relies on the programmer to use proper indentation. The following code (JavaScript on the left and Python on the right) executes in the same way, but it’s a reference to the different syntax for either language.
At a smaller scale this seems fine, but when your codebase (your programming project) gets much bigger, it will be difficult to keep track of indentation and how everything is executing. While using Python, you’ll be more prone to syntax errors because of the variable to keeping track of your indentations. While in JavaScript, indentation doesn’t matter as long as your code is within the curly braces. In a high majority of mainstream languages, JavaScript is very similar to all of them syntax wise. You won’t be using indentation with any other mainstream language, which gives Python users a larger learning curve to different languages. Along with Python’s unique syntax, many of its simple keywords and operations are different from the vast majority of languages.
The majority of the web is using JavaScript to power their websites. Learning it will help more people understand how the web works. Many websites use JavaScript to power their backend and frontend applications such as the FAANG2 companies. With this, it can be a gateway to learning even further about how the web works with data transfer protocols like HTTP since JavaScript has many different libraries to support creating your own servers. On account of JavaScript powering the web, many companies are looking for JavaScript programmers.
Because of JavaScript’s popularity, there is an abundance of documentation and solved questions on many sites to help you when you run into problems. As of right now, Stack Overflow, a popular website for programmers to ask questions, has over 2,000,000 questions relating to JavaScript. With that, there are over 1,000,000 libraries in NPM, Node.JS Package Manager, and over 900,000 repositories in GitHub that developers can use for games, websites, applications, etc. which are all open source.
In Python, there are a bunch of helper functions3 that make Python easier to work with and reduce development time. But as a beginner, these helper functions could be hurting you. Having Python do all the long tedious functions behind the scenes for you will leave beginner programmers unaware of how the underlying code is actually working. Then if they go to a lower-level language4, where they provide the bare minimum helper functions, they will have a tougher time learning that language. While in JavaScript there is an ideal amount of balance between what the language does for you and what you have to do on your own. Because of this nice balance, while you’re learning how to program for the first time, you are also improving your problem-solving skills.
While Python is an easy intro to programming, many of the features act as a facade compared to all other programming languages. Day by day, JavaScript is getting larger and more applications are being developed for the language.
- Black box programming is knowing what a function does, but not how it works.
- Facebook, Amazon, Apple, Netflix, and Google.
- Helper functions are functions built into the language that, generally, does tedious jobs to speed up and help the programmer’s development.
- Lower level languages, like C++ or Java, are languages which are compiled and statically casted that have the bare minimum of helper functions.