Relearning Javascript

09 Sep 2021

Javascript is one of the first programming languages that I learned. The last time I ever used Javascript was back in high school over 5 years ago when I first got introduced to programming. This javascript refresher course was very helpful as it reminded me of certain attributes of javascript that are not present in many other coding languages. It also updated me on what’s new with javascript. When I first learned the language was right around when ES6 came out, but it was so new that I did not learn it or even hear about the update. It was a nice surprise to see that There were things I didn’t know about javascript which made the refresher course a lot less boring.

Javascript is usually the first choice for teachers to introduce students to programming because of its ease, versatility and it’s overall forgiving nature. Although it is great for introducing the concept of algorithms and the general structure of most programming languages, it is not my programming language of choice. Something I was reminded of during the refresher course was how lax javascript is with variable and function declaration. Most programming languages require you to declare the variable type for memory allocation purposes. I found myself accidentally declaring for loops with “int i” instead of “var” or the updated “let”. I have become accustomed to declaring the type of variable and using that variable for only that specific type. I find that having a “one for all’’ variable declaration leaves a lot of room for error, especially for those programs that rely on a user-interface to attain data. If you use a variable to get a user input that was supposed to be used for a number, but instead gets a string, your code will fail unless there are protections that you code in. Furthermore, the implications of having the “one for all ‘’ variable declaration allows for a variable to be used to hold a number then used to hold a string, or vice versa, making possibly very confusing code. The same goes for functions and how you don’t declare the return type of a function or method. It leaves a lot of room for error in javascript programming.

Although it is nostalgic to relearn javascript, knowing what I know now, It would not be my first choice of language.