Node.js!? Why use it?

Know your why! Avoid making blind coding choices.

TL;DR
Node.js is fast.
It allows a company to hire only JavaScript engineers.
It can work on multiple platforms, other than the web.

When first introduced to Node.js in 2014 I was shocked by what I was seeing. Ward Bell was giving a demo of Node.js, ExpressJS, and Jade. Jade has since been renamed to “pug”. Node.js surprised me because it was easy to set up a web server. In my experience with Microsoft technology it was never that easy. The web server came with “software bloat”. Plus developers had to buy a license for Windows Server to run “Internet Information Services” (IIS). Contrast that with a Node.js web server that can be set up with as little as five ( 5 ) lines of code.

When Ward was done with the entire demo, I was still wondering how he got a web server running in JavaScript. This server didn’t have any security. I wouldn’t say it was ready for enterprise environments, but on a software development machine this was less of a hassle than I was used to. Node.js was about to change my world, and I knew it.

Later I found that the web server he used, ExpressJS, was only the tip of the JavaScript iceberg. Node.js has so many features and benefits. One benefit is how lightweight it is. Node.js version 10.13 is only a 15 MB download. Compare that to Windows Server 2016 at 32 GB.

Node.js lends itself to being highly customizable. The initial application has basic functionality and then you add what you need. Even the ExpressJS web server that I mentioned before can be substituted for another web server package depending on your preference. ( Hapi, Koa, Meteor, Socket.io, Sails, etc.)

JavaScript has so many software packages and choices available that one can get overwhelmed. It is often called “JavaScript Fatigue”. To overcome this, I turned to the internet. I found many JavaScript communities online, some in my own city, and I even created one here in Berkeley (BJD). I love the JavaScript community! After developing software alone in the “Hinterlands” it was refreshing to discover how open the JavaScript community is. I feel the community at large is comprised of welcoming groups of engineers and hobbyist, looking for other likeminded souls. I think there is a bit of a positive feedback loop happening because everyone benefits from the “mostly” open source code. The support from the community is not limited to Node.js.

Community and support are huge benefits but Node.js has some essential winning characteristics. These are results that you can show off.

1. “Node.js is fast.”
Node.js is built for the web, it is designed to work like the web does. Node’s asynchronous behavior can handle the many data packets being transmitted all over the place. Node.js accepts all those network requests, never stopping the flow of data. Once the request is completed the response gets routed back to the sender. Basically the web user’s multiple clicks are recorded and served when done. Some requests are completed faster than others, but all get worked on and no one is turned away.

2. “Enables Full Stack JavaScript”
No company wants to spend more money than they have too. I think the hidden beauty of Node.js for business is the ability to hire engineers who know one language. What does that mean? For example, companies would traditionally hire a Linux engineer for the back-end servers, then a database engineer, then a front-end engineer for the website. Those engineers are specialized experts in what they do, but they aren’t always busy at the same time. Each engineer gets paid whether they are busy, or not.

“What If?…” the same company could hire engineers who specialized in JavaScript? In the same business example they hire one engineering language. Those engineers can design and setup the back-end servers, created in Node.js. Then work on the database, created in MongoDB. Then finally work on the front end, created in AngularJS. Now the business has hired all JavaScript, making it more agile. It is easier to move engineering resources around as needed.

All businesses go through project phases. When the company doesn’t need 40+ hours of your time what do they do? The answer is simple if they are a full stack JavaScript company. You can move engineers around to fit the your needs. Designers can become maintainers (fixing code bugs), or develop new code features, or even work on refactoring the original code for efficiency. The possibilities are endless with Node.js as the back end, and JavaScript everywhere.

3. “Cross-platform development”
The Holy Grail is that Node.js isn’t only for the web/internet. It can also be used to develop desktop applications. Did you know Slack was written in Node.js using Electron. What!! Yes! JavaScript is winning by making every engineer as useful as they want to be. Does this mean that JavaScript is perfect? No. I suggest using Node.js as the business defines it’s needs and figures out the “pain points”. Then look at refining the product to address those issues. If you need more speed you might have to find another language or product. If you have a choice Node.js is the way to go, it even works for NASA (Github).

Node.js is just fine. Let’s say it is the “goldilocks” of software development. Not too much, but enough to get the job done. How can you get that idea off the drawing board (Pitch Deck) and into a workable demo (MVP) that is ready for the market ($ales)?… I suggest using Node.js.