Why Do So Many Complain About JavaScript?

Why Do So Many Complain About JavaScript?

Introduction

Anytime you go on twitter chances are that you’ll see somebody complaining about JavaScript. It’s usually due to some bit of syntax that might seem superficially unintelligible. But that may just be a by-product of how so many programming languages are so far removed from their inner workings in recent years. While JavaScript is by no means a low level language, there are many quirks of the language that may seem peculiar to the uninitiated. Well, that and the original version of JavaScript wasn’t meant, on its own, to do all that much. Those factors remind me of the C programming language and, to a lesser extent assembly language.

Other Languages

These languages were originally created to solve, albeit different, very specific problems. They were made to have a small subset of features that are nearly pared down to only the most necessary requirements to get anything done. Then, much more was added to each language in subsequent releases and through the creation of libraries and frameworks. Now, nearly anything can be done by programming in those languages and so much more than would have been originally expected. However, the older structures that originally existed are still completely valid. So, it’s very much possible to use an old construct along with some new feature that might be found in any modern language. It can all be found together in the same block of code.

Assembly language

The structure of assembly language is limited to the features that the processor allows. If there doesn’t exist some operation at the processor level, then the assembler can’t understand the operands provided by the programmer. It is only through libraries and structures built upon the possible operands that there is anything available beyond the processor. So knowing the very basics of the operations of the given processor is key to writing efficient and useful assembly code. Then, it can quite the monumental task to understand how the various operands and operators work together, especially to anyone without the necessary knowledge to work with them. Similarly, there are peculiarities of C that can give a novice programmer quite the headache.

C programming language

C was created to solve many programming challenges associated with creating the unix operating system. One of which was portability. By the very nature of assembly language, it takes a lot of work to port assembly code to another system architecture. Namely, a total rewrite of the code to accommodate the different flavor of assembly as well as considerations for differences in its architecture. C provided a solution to take care of these issues; however, C is still very close to the hardware, conceptually.

There are constructs in the language that provide an abstraction of what is going on at the processor level, such as not having to be concerned about the size of memory locations and the like. There are other constructs in the language that even the more experienced programmer can find trouble with. Pointers and similar memory management features are often a point of contention for programmers who prefer languages that handle those concerns under the hood. There are a host of different issues in programming JavaScript.

JavaScript

As a scripting language, there’s quite a lot of overhead that must be considered when programming in JavaScript. The browser might run a slightly different implementation and there’s yet a difference when running code on the backend on node. Still, there are legacy concerns to be also considered when programming in the language. The language was only meant to be used as a light weight solution to manipulating such structures of a webpage such as the DOM. Initially, there was only thought to be need to have simple control flow and do other such simple tasks. Why ever would anybody need OOP capabilities or modules or any number of other constructs that any modern language might have?

While Typescript handle much of what was lacking previously, JavaScript contains many of the features that some of the modern languages have. However, much like in Assembly and C, at least a decent understanding of the underlying structure is required. Knowledge of the call stack and event loop can help the programmer in not having so much difficulty in implementing the desired solution to some problem. So, just like in the other language we’ve discussed here, an impatient or novice may not completely appreciate what is required to program effectively in the language.

Conclusion

So, as is the general tendency these days, people can get frustrated when things don’t work quite as they might think. Writing a program in JavaScript can be overly complex for what the programmer is trying to accomplish and too many considerations may have to be made for many, especially the modern programmer, to enjoy using JavaScript for much of a complicated problem. Frameworks and platforms have been created to assuage those concerns. Much like the need, in many people’s thinking, for frameworks and the like for CSS.

There are as many concerns in CSS and maybe even more. So, it’s another contender for programmers complaining about using it and wanting a framework to ease it. But every new language provides an abstraction so that the programmer doesn’t have to deal with the lower level programming concerns. And that is what people are gravitating towards and why they’re complaining about the languages where the average programmer doesn’t want to be concerned about.