JavaScript is Not a Good First Language

02 Sep 2020

I am not completely new to JavaScript, in fact, I’ve used it a fair bit in my high school STEM class. In that class, I used HTML, CSS and Javascript to create a website for a project in the class. The website was a reservation page for a hotel, it allowed guests to book rooms for their family. In the project, I used objects to hold the information about the guests and we pushed those objects in to arrays that represented hotel rooms. It was an interesting project that introduced me to many programming concepts, such as arrays, for loops and objects. In a way JavaScript was the first “real” programming language that I’ve learned.

Over the course of two years, I have spent my time on learning more programming languages such as Python, Java, C and C++. However, I’ve also managed to have forgotten many of the quirks and trick of JavaScript programming. Thankfully, the use of free code camp allowed me to quickly recoup some of the knowledge that I have forgotten and it even taught me some new ideas that I never learned while I was in high school.

The smartest thing about JavaScript is its ability to figure out what type of variable I wanted without the need for me to explicitly state that a variable is a integer or a string. This allow us to do some pretty funky stuff such as:

var i = 1;
var j = '1';
console.log(i+j); // "11"

This is great if you needed to add a integer with a string, or to create a function that could return both strings and integers. But I remember when I first started on Java and didn’t understand type, the habits I got from JavaScript was not the good ones and it has led me to write some pretty bad codes.

From personal experience, I’ve led to believe that JavaScript is not a very good language to tech to a new programmer, because of the lack of obvious type in its syntax. I believe that languages such as C, is better at reinforcing healthy coding habits and basic programming knowledge due to it’s punishing nature. However, I believe that different programming languages have different strengths and I look forward to learning more about JavaScript and to applying it properly.