The Versatility of JavaScript

Anmol Nigam
7 min readFeb 7, 2019

--

Why going full-stack with JS makes sense for startups.

Photo by Temple Cerulean on Unsplash

There is probably nothing in the programming world that receives abundant love & hate, equally, like JavaScript. The reasons for both suffice absolutely.

Some love it for its easy-to-learn attribute.
Some hate it for its lack of typed variables.
Some love it for its great community
Some hate it for its lack of crazy amount of performance.

However, for early-stage startups, for guys who want to build an MVP & test if their idea is worthy, going full-stack with JS is a no-brainer.

JS offers everything that a startup could need to build a testable version from scratch. Its developers fluent in just one language, JS, can code both front-end & back-end.

Startups shouldn’t get hung up on the issue of scaling & worrying about the performance issues that might surface when their product becomes big enough to give them technical headaches.

You might not get to arrive at that stage if you don’t build an MVP fast enough so you could test if it even resonates with your target audience.

Solutions tailored to your product’s penetration can effectively be built later & tweaked accordingly.

However, until you get to that pedestal, it’s just all dreams floating in the air!

Your developers would be on either team. The team ‘JS Love’ or the team ‘JS Hate’. Let’s get to know why —

Team ‘JS Love’ adores JS because:

Learning Curve

It’s simple to learn and implement relative to other languages which have a steep learning curve.

One language to rule it all.
You can do almost anything using JS!

You can:

  • code client-side using Angular
  • code server-side using Node.js
  • develop a web app using React
  • make a mobile app using React Native
  • build a desktop app using Electron
  • do machine learning using TensorFlow

These great many uses make JS, the king of versatility and nothing topples it!

Good team efficiency

Using full-stack JS reduces the overhead that comes along with having separate front-end & back-end teams.

Since all ends are being coded in JS, the understanding of the codebase is much, much better which leads to getting more development time.

Ease of building an MVP

Vast amounts of development time wasted upon an untested idea is expendable.

Adopting full-stack JS like MEAN stack or the holy combo of NodeJS & React. It helps developers build an MVP in a tight timeline. We are talking weeks here!

Time-saving bonanza

JS offers extensive code reuse and sharing capabilities as logic and implementation on front-end & back-end are too similar.

This reduces the number of lines of code which ultimately helps in maintaining the code base.

Awesome community

https://stackoverflow.com/questions/tagged/javascript

Stack Overflow, the go-to place for all developers has a very active & supportive JavaScript community which caters to almost every question that a programmer might have regarding the language.

Source: merehead

JavaScript easily defeats other languages with a huge popularity factor. It merely implies that the higher the number of developers using it, the better the communities like Stack Overflow shall become.

GitHub, the open source heaven for programmers, regularly features the trending projects on its website to showcase what’s catching people’s attention daily.

Source: GitHub

Beginners can start practising their JS learnings by working on awesome beginners-friendly projects, again on GitHub.

Ease of hiring talented developers

Source: myself

So many A-grade features of JS make the pool of developers to hire from really big.

There is a lot of good ‘fish’ in this pool of developers & a company might not go wrong with its choices too much.

Speed

Node.js brings event-driven programming to web servers, enabling development of fast web servers in JavaScript.

Developers can create scalable servers without using threading, by using a simplified model of event-driven programming that uses callbacks to signal the completion of a task.

Node.js connects the ease of a scripting language (JavaScript) with the power of Unix network programming.

Source: myself

To prove this, PayPal published a comprehensive report on the results they have seen in the process of migrating from Java to full stack JavaScript.

The company was able to make the development almost two times faster while reducing the engineering personnel involved.

Moreover, they have seen a dramatic improvement in performance, doubling the number of requests completed per second and decreasing the average response time by 35% for the same page.

This means that the pages are served 200ms faster, which is a remarkable result. [source: altexsoft]

Team ‘JS Hate’ strongly dislikes JS because:

It’s a weakly-typed language

A loosely typed language is excellent for small applications. Being weakly typed, it catches fewer errors, and many reach the compile time.

As the application size grows, managing a language this kind becomes unbearable & impossible, and a developer has to depend on IDE & the compiler.

However, if the application size ranges between small and manageably-large, this provides excellent ease of not having to define variable types and keep track of them.

Crazy performance — NO!

Although JS provides excellent performance for small-sized applications and performance lags once the size starts climbing up the charts.

Too many dependencies, poor event handling and unpredictability due to heavy interactions between a browser & user slow down its performance.

Server-side JS aka NodeJS isn’t the ideal solution when it comes to handling heavy computational tasks, data processing, mathematical computations massive projects.

The single-threaded approach of NodeJS becomes an anti-self as a massive computational task handling blocks the other requests.

There are numerous ways to overcome this limitation.

By merely creating child processes or breaking complex tasks into smaller independent microservices, that use more suitable technologies and communicate with your back end, you can handle complex computational tasks in Node.js. [source: altexsoft]

[source: altexsoft]

Boring to document code

It’s a harrowing task to document a large JS codebase.

Instead of going the usual JSDoc way of documentation, you can learn how to do it in a much and better and effective way here.

Relatively young technologies

Even though JS has an accommodating and active community, the technology itself is pretty new when compared to other server-side languages like PHP that have been around for many many years.

As an example, some developers cite the immaturity of the connections between Node.js and relational database tools, such as MySQL, Microsoft SQL Server, and PostgreSQL.

Jack of all trades, master of none?

It is a common belief that a developer can genuinely master only one area of knowledge.

With every other skill gained the quality of his/her expertise declines!

While syntax and grammar of JavaScript are mostly the same on client and server side, there are still many details to consider. Aside from being proficient in front end development, full stack JavaScript developers need to have an expertise in back end programming, such as HTTP protocol, asynchronous I/O, data storage fundamentals, cookies, etc.

That is why some say that there are really no full stack engineers: Every one of them is either front or back end oriented.

However, we have all the reasons to disagree, based on our own experience and strong JavaScript skills.

Drawbacks of every separate tool in the stack combined

As every technology stack, MEAN combines the weak sides of all four its elements. Most of them are minor technical limitations, which appear under a specific circumstance. However, to use the stack, it’s essential to realise possible bottlenecks of every tool and adjust your development strategy accordingly. [source: altexsoft]

Most of its horrendous drawbacks only arise when an idea remains a startup no more. You have languages like C++, GoLang, Scala, etc. to make custom scaling happen.

For a startup, all that matters is the validation of their newly generated idea and JS is an all-rounder language to build an MVP.

Founders could see their idea become an acceptable reality by adopting this versatile language.

--

--

Anmol Nigam

I write bespoke content to help SaaS brands grow organically.