What's up!

Pyaarey Allah!

Saturday, July 14, 2018

Is node.js still immature?

Recently I was interviewed and accessed by a technical auditor. These people claim to visit incorporations internationally and talk on technical and non-technical aspects and processes of companies. They interview the technical leaders firstly and then speak to the team. After that they send written recommendations to the management, get approval and then dispatch those recommendations to the team leaders.

By background I was doing all my R&D on how I could use AWS cloud and node.js capabilities to achieve best of pricing, development, deployment, testing, DB storage, file storage etc. I was writing a small but comprehensive boilerplate app where I was testing almost s full life cycle of development and then test and deployment.

The interesting part of our discussions was that the accessors commented on node.js as an immature platform. Of course no developer in the current world ignores the importance of node.js and knows that node.js is emerging part of software development.

So as the accessor said: "Do you know Asif, we totally appreciate your efforts and like your work and R&D but we think that node.js is an immature platform yet. I said, "What in node.js is immature sir" and he tried to argue and me as well. During such comprehensive assessment we never have time of few seconds to touch a topic. Either they will not go in detail or will give you maximum of 20 seconds to explain your point of view. Which sometime is cruel for some topics and sometimes even 20 seconds is a total waste of time; but this is what it is.

My question remains there. Is node.js an immature platform? My head kept revolving around the same topic. One day in my life I want to speak to the same accessor and explain to him one single topic which is: "is node.js an immature platofrm"

So here my friends are my arguments

What exactly in node.js is immature? By core node.js is neither a web server, not a tool to give you anything finished. Node.js just runs on V8's JS engine and some of threading handled by libuv. What exactly you want node.js to do for you? My friend: node.js is just a baseline platform of tool to allow you to use whatever you want to do with ECMA/JS. That is it. So the tools which you use such as express, koa or meteor or anything matter; node itself has no big tooling other than providing a base installation on your machine.

Once we understand that node.js itself is too small to be called a "Solution provider" We must go and check "what makes node.js a "solution provider" Here is the list of things which make node.js an ultimate solution provider.
    1. Package manager examples
      1. NPM
      2. Yarn
    2. Webserver tools/framework examples
      1. express
      2. koa
      3. meteor
    3. Language options
      1. ECMA any version is possible
    4. Databses
      1. Anyone of your choice
    5. Data access layers
      1. Knex
      2. Typeorm
      3. sequelize
    6. Development tools/Views controllers etc
      1. Angular
      2. react
    7. TDD
      1. Chai/Mocha
      2. Jasmine etc
    8. And so so much more no npm and yarn
As we can see there is a good list of tooling around node.js, almost everything, then we cherry pick tools of our own choice. Such as I can prefer Angular over React or vice versa.

Then lets start comparing these cherry picked tools with one big solution provider framework such as ASP.NET
ASP.NET solution has these components
    1. Database layer usually SQL Server
      1. Entity framework for data access
    2. C# coding layer
      1. Services or BLL
      2. Data Access layer including repository and unit of work
      3. Dependency injection
      4. Controllers
      5. Routing configuration
      6. Application startup coding
      7. Request interruption such as Authorisation attributes & Action Filters  
    3. View engine
      1. Razor
    4. Front-end coding layer i.e JS
      1. All the tooling you can use in browser using JS/ECMA
Now we take each one of these components and start comparing with what is available on github in node.js tooling. We can start comparing test cases ran on the tool and we will find out that in node.js the tooling is tested and developed by mature teams which run countless tests on their own tools, and we can also compare how comprehensively issue tracking is done on tools.

For rapid examples
    1. View engines
      1. React: 100,000 stars, 18000 forks, 1200 contributors
      2. Angular (views and more) 58000 stars, 28000 forks, 1600 contributors
    2. Scripting
      1. Typescript, 36000 stars, 5000 likes, 316 contributors   

Lets create a list of comparisons of choices and maturity, This is done a format that first I will narrate ASP.NET component and then put a :: symbol and narrate its alternate in node.js 

  1. Database layer usually SQL Server or any db :: node can also use any db
    1. Entity framework for data access : substitutes I wanna mention
      1. Sequelize 15k stars with 700 contributors, 8k commits & 374 releases
      2. Typeorm 7k stars with 200 contributors, 3k commits & 36 releases
      3. Knex 7k stars with 240 contributors, 2k commits & 118 releases
  2. C# coding layer
    1. Services or BLL :: Usually done in C#
    2. Data Access layer including repository and unit of work
      1. Mentioned above
    3. Dependency injection :: Usually not needed bec of JS's nature of require(...) still there are plenty of good tools such as 
      1. https://github.com/jaredhanson/electrolyte
      2. https://github.com/jeffijoe/awilix
      3. https://github.com/luin/express-di
    4. Controllers :: three choices we can mention
      1. express 39k stars with 200 contributors, 5k commits & 275 releases
      2. koa 22k stars with 153 contributors, 1k commits & 70 releases
      3. meteor 40k stars with 390 contributors, 21k commits & 1100 releases
    5. Routing configuration
      1. Part of controllers framework
    6. Application startup coding :: All in your control in node.js
    7. Request interruption such as Authorisation attributes & Action Filters  :: All controller framework have great startup and middleware support much more powerful than ASP.NET
  3. View engine
    1. Razor :: In node.js you have so many view engine choices over 10 good ones, so there had to be a need to consolidate and now there is consolidator for express
  4. Front-end coding layer i.e JS
    1. All the tooling you can use in browser using JS/ECMA :: Same for node.js

So we can see that there are so so many mature choices in node.js as of today. We need to cherry pick a good tool for us. The conclusion is that node.js itself is not tool to be called mature or immature. Node.js is a baseline product which allows you to start playing as you like. Then you start picking from huge range of toolchains that you like. And if you make a mistake in your selection, that is purely your mistake not node.js. Also node has substitute for every tool in all popular desktop and web frameworks. 


Further reading: https://www.toptal.com/nodejs/why-the-hell-would-i-use-node-js
In this article Tomislav Capan explains some under lying architectural details and then explain some good tools. Worth reading. 

0 comments: (+add yours?)

Post a Comment