What is GOOD about Node JS
Node is popular. So it can be the case but we have to deep into, aren’t we?
When you are trying to choose a language you have to evaluate that language with something. Every language has that and most of the time it accepted by the community. Yes, it is the philosophy. So let’s talk about the Node JS philosophy today.
The Node JS philosophy
Most of these principles come directly from its creator Ryan Dahl (who does not like Node now) and others come from the people who contributed to the core.
Small core
Node has really small set of functionality. Small means more flexibility and less problem. It kind of seems bad thing but you’ll see it is a feature not a bad thing. Despite the fact Node has huge set of packages created by the userland. For example we can take nodemon package. Well Node has that functionality now to watch for a change (node — watch command) but it did not (I don’t know why they added that meaningless thing to the core).
Small modules
Node simply uses module to structure the code of a program. It does make a lot of sense to create/use small modules. Because you can be sure that small modules are well tested, easy to understand and maintain. The main thing is that it can serve to a single thing. email-regex module can be a great example (also it is a few lines, you can write it yourself :) ). Node applied DRY principle at a whole new level.
JavaScript in the Heart
Node is on JS. So you can write both server side and client side with same language. Also Node uses V8 engine which is very fast, secure and open-source.
So now you are familiar with Node philosophy a little bit. I don’t recement using it without TypeScript which I am gonna talk about my next blog.
References:
- Node JS official documentation
- Node JS Design Patterns book