@adlrocha - Is Javscript all you need?

Or is it?

Disclaimer: This is an op-ed publication, and some of my analyses may be biased. This is why I highly recommend having an open discussion about the matter.


three person pointing the silver laptop computer

The idea for this publication came to me when I received one of Hackernoon’s newsletter with the title “Javascript is all you need: Fact or Fiction?” and the following newsletter preamble:

On one hand, you have the internet saying, "If you're going to learn just one programming language, go for Javascript."

But on the other hand, some veteran software developers who say, "Javascript isn't a real programming language."

In the end, this preamble from Hackernoon was only used to introduce their top Javascript stories, but I said “why not? let’s dive in this matter and share a heated discussion with my readers”. Is Javascript all you need? If you had to start from scratch, would you go for Javascript from the beginning?

What does Twitter said?

To start my research about the topic, I decided to ask my Twitter followers with the following poll:

Only 13 of them answered. It wasn’t a meaningful sample, but enough to see there was a division of opinions.

Only an 8% considered that Javascript was all you needed, a 23% of trolls (or honest respondents) didn’t consider Javascript a programming language at all, while a 62% thought that JS was OK, but not enough for a versatile programmer or software engineer. This served as a light indication of how Javascript may not be all you needed after all.

And what about using reliable sources of data?

As a consequence of the limited amount of data I acquired from my poll, I decided to go to more reliable sources of data. My first stop was at StackOverflow’s 2019 programming language survey. In the section dedicated to the “most popular technologies”, we can see how Javascript and HTML, due to the ubiquity of web development, ruled the ranking.

In my opinion this data only shows how Javascript is everywhere in frameworks and technologies of the most popular field in the programming community, web development. But this doesn’t answer our question at hand, “Is Javascript all you need?” It may be all you need for web development, but software engineering and programming are way more than just web development.

(It is not in the scope of this publication, but Python’s 4th place accounts for the rising interest in big data, data science and artificial intelligence —along with web development in Python, of course—, in case you were curious).

Ok! A lot of people use Javascript, but what do they think about him? According to the respondents of Stack Overflow’s survey, the most loved programming languages by developers are Rust in the first place (I definitely get that, is my favorite language with Go but, WTF? I wasn’t expecting that), Python in second place (it makes sense, AI, big data, easy to use/learn, etc.). The third place is for one of Javsacript relatives, Typescript (I also can see why, a typed superset of Javascript adds a lot of value). You have to go to the 11th place to find Javascript in the ranking. So maybe after using it people don’t like Javascript as much as you would expect from the data extracted in our previous ranking.

However, if we move to the “most wanted programming languages by developers” (people that don’t use it but want to learn it) we find Javascript again in the first places. What can we infer from this? That due to the ubiquity of Javascript in web development, people want to learn JS in order to be able to develop for the web, but once they try it, people seem to be quite disappointed.

In any case, even with all this amount of data, I am not in the position of answering our question at hand. So let’s move to other reliable sources of data.

Where are you JS?

So now we know what developers think about Javascript, but to understand if JS is all you need, we need to know where is JS being used. For this matter, we use the data from IEEE’s programming language survey 2019, which includes information about where programming languages are being used.

According to this survey, Javascript is in the 6th place of popularity in the ranking. And where is it being used? As we already expected, plainly and exclusively in web development. It is true that unlike other programming languages used for web development which are only used for backend development, Javascript is present everywhere in the web, in the back and in the front.

In light of this data, I would say that Javascript is OK if you want to become a web developer, but it is not all you need if you want to become a versatile developer able to range from embedded systems development to desktop and web development. According to this data, you would be better off learning Python than Javascript if you want to target a wide range of systems development.

However, to be completely fair —and being a bit critical with IEEE’s data— through the use of different frameworks, Javascript is also present in desktop software (through the use of Electron), mobile devices (using React Native or Ionic) and embedded systems (with alternatives such as CylonJS). So does this mean that, indeed, Javascript is all you need?

Javascript is OK, but have you heard of WASM?

And my final answer to the question is “it depends on the type of programmer you are”. If you just want to know the basics to make systems work, and you don’t care about using abstracting frameworks, having low levels of control over your code, or aiming high performance, then definitely, Javascript may be all you need.

If on the other hand you are like me and you like to clearly understand what is happening under the hood, and how your systems work from the ground up so you are able to optimize it and modify it at pleasure, then Javascript may be OK but not enough.

And you may be wondering, “what are my options if I am from the latter group? In the end if I want to be a versatile software developer able to range from distributed system to front-end development, I would be better off learning Javascript, right?”… or do you?

wasm-pack

If you are asking this question, maybe you haven’t heard about Web Assembly (WASM). “WebAssembly is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable target for compilation of high-level languages like C/C++/Rust, enabling deployment on the web for client and server applications.” Client and server applications, i.e. using WASM you can even develop efficient front-end code in languages for grown-ups such as C++, Rust and Go.

So is it Jasvascript all you need? In most of the cases, “yes”, JS may be all you need to become an average developer. But if you are like me, and you want to become a versatile and skilled developer who completely understands his systems, and is able to get the most out of them in any scenario and hardware infrastructure (from cloud infrastructures to embedded systems and front-end development), then I would go straight to learning a WASM-compilable alternatives such as Rust or Go (see the bias, right?).I am also in the quest of becoming this type of developer, so let’s leave the matter of WASM, Rust and Go for other publications, and let’s make this trip together.

For now, I hope I have given some light to the question “Is Javascript all you need?” with my view of the matter. Now let’s start a discussion and fire your opinions at me.

References