I’m not a complete beginner in Javascript, however my experience with the language pales in comparison to that with Java as it was the language in which I first learned to program, and will be used as a comparison to Javascript in this essay from the perspective of a programming novice.
Being a more intermediate Java developer, I do welcome the more immediately noticeable changes when switching over to Javascript, this being the “ease of life” syntax differences. You don’t need to end every line with a semicolon, there are far fewer data types, you don’t specify data types when initializing new variables, objects and arrays can be printed to the screen easily, etc.. These changes make programming a bit more quick and simple, however, this also seems to be the cause of my biggest issue with Javascript so far as a beginner. In Java, which is statically typed, the compiler acts as a nanny in terms of holding the programmer accountable for every syntactical mistake. If you try to run a program with any missed data types or if you are passing a float argument when the corresponding method’s parameter specifically requires an integer, the program wouldn’t even compile before you fix every mistake. This can be somewhat frustrating when first starting out in programming as it takes some time and practice to even understand the errors preventing you from making progress. However once you do get some experience, you’ll find that these error messages are incredibly helpful in pinpointing exactly where your mistake is and how to resolve it. Furthermore I personally find the static typing of Java to be helpful in giving a little more information about each variable and parameter at a glance without having to refer to code documentation.
On the other hand, Javascript is comparatively rather lenient. In theory, the dynamic typing in addition to the many other processes that Javascript automates for you such as converting a number to a string should make the learning process smoother and more streamlined for a budding programer. Despite this, in practice I’ve found these changes to cause quite a few problems. Countless times would run a Javascript program with no errors only to be met with unexpected program behaviour. I would scroll through my code and spend time double checking my boolean logic only to later realize that the actual problem is somewhere before the IF statement where I missed a comma somewhere in my array of property packed objects. The most disheartening feeling I have felt as a programmer is seeing that my program clearly isn’t working yet lacking a single clue as to what went wrong. This is my biggest issue with Javascript as a learners language. It’s a bit too lenient when it comes to syntax and it does a bit too much for the programmer.
This is also why I think Javascript is a much better suit for a more advanced programmer, as long as it’s one with some background knowledge in debugging. The issues I’ve previously addressed become points of praise for a developer who already knows about each data type, can efficiently read code, and is tired of looping through every array to print it’s elements or making a “toString()” method for each object. Being a higher level scripting language, you are already able do much more with less lines of code in Javascript, but the fact that the syntax of Java and Javascript is so similar have made for a smooth and enjoyable transition for me. Furthermore, with the added functionality introduced in ES6, I find myself programming even more efficiently when working with loops, arrays, and arrow functions. All of these factors culminate together to create a fun yet information and practice filled first module of web development learning.