What Javascript is still lacking

Osgood Gunawan
3 min readSep 14, 2020

--

According to a Stack overflow 2020 survey, Javascript rules the most popular language among developers in the tech industry. But why is Javascript not a huge favor in terms of the algorithm and data structure world? Or competitive programming? Or in writing code efficiently for various applications? Most people in this area widely use C++, Java, and Python but not Javascript. Why?

Last week I was trying to solve one of the questions from binarysearch.io.

Here is the question:

You can check the problem here.

This type of problem would be such a nightmare for Javascript users. If you compare Javascript with a Python solution, You can see a considerable amount of productivity loss, writing less code(check the pictures down below).

Python Solution: using a builtin class ‘Fraction’ to solve the problem
Javascript Solution: Implementing from scratch

Without a decent standard library, Javascript users need to implement specific tasks from scratch. It leads to wasting time and productivity for solving a question like the above example.

Besides decreasing productivity, many Javascript developers have difficulty implementing data structures and algorithms knowledge due to a lack of a decent standard library. Other than arrays and hash tables, they may not know how to compute values efficiently in their system or unknowing the cost of manipulating data in their programs.

Data structure such as a queue or heap in Javascript is not supported; you will need to implement it from scratch, and yet the time complexity matters. In reality, we need to understand the data structures and algorithms knowledge in depth in dealing with more complex data. Something such as popping value from the head of the array, bubble sorting an array, and lack of utilizing hash tables are examples of run time’s inefficiency that is happening a lot in Javascript developers today.

With a well kept and a decent efficient standard library would change all these symptoms. Not only does a decent standard library give Javascript developers better techniques, but it will also ultimately Javascript developers will write more efficient programs.

As always, thank you for your time to read, and I hope you enjoy it!

--

--

Osgood Gunawan
Osgood Gunawan

Written by Osgood Gunawan

UX designer | Software Engineer | Dancer | ETL Developer | Data Migration. More about me : https://www.osgood1024.com/

No responses yet