Node.js vs Java
Created#More Posted time:Sep 2, 2016 9:37 AM
More and more colleagues are talking about Node.js, about its asynchronous IO, event callback and uniform language for both foreground and background development. For entrepreneurs, you may have chosen Node.js for your first project as you desire to complete development in one language to save time and costs. But I was “ridiculed” when suggesting Java as the project architecture to colleagues from other project groups. They thought I was outdated by still sticking to Java. I also found that more and more front-end colleagues are tapping into back-end function development using Node.js. As a background development engineer, I feel the stress.
So leveraging the opportunity of the new project, I systematically studied the knowledge system of Node.js. This article summarizes the Node.js technologies I learnt and compares counterpart technologies of Java, in an aim to provide some decision-making reference for architects evaluating the two types of architecture. To avoid disputes, this article does not make any recommendations on architecture language, and does not make forecast on future trends.
Background of languages:
The comparison of the origination of the two languages reveals that PHDs are typically good at exploring in-depth technologies while computer technologies are not necessarily the contributions of computer professionals.
Language and SDK analysis:
In comparison, Java is object-oriented and has become even more powerful and stable after 20 years of development. Compared with Node.js, Java is a giant with a breadth of expertise in various fields. But it is just because of this that Java is much more costly to study than Node.js is. Every small technical detail of Java is worth a thick book. Java is also keeping abreast with the times by supporting asynchronous IO and event callback in its new SDKs, and Java open-source projects are also continuing to grow.
Third-party open-source framework selection:
After the language is decided, the framework selection follows. A good framework can save a lot of unnecessary duplicated efforts to easily empower the project to have powerful features. Of course, the introduction of third-party open-source frameworks also gives rise to the learning costs. Similarly, Node.js frameworks feature a low learning cost due to its short history and developers may find it easier to access more underlying source code, but some frameworks are prone to stability and compatibility issues. In addition, NPM developers vary in their development skills and there are no effective evaluation mechanisms. So you need to be cautious when selecting some modules (especially C/C++ modules). Java third-party open-source frameworks have been widely applied in a lot of enterprises and feature mature and stable performance and powerful features, as well as well-designed encapsulation and layers. After a higher learning cost, developers can enjoy a foolproof usage. In terms of Web development systems, both programming languages can find many open-source frameworks ready to be reused and introduced.
Execution engine analysis:
Node.js's asynchronous IO and event callback are its trump card, but other programming languages are also catching up on this. But Node successfully uses one language for both the front-end and back-end code, which is definitely second to none and has attracted lots of developers. But V8 engine contributes to both the success and the cause of failure. Its development is not light-packed, but Node.js is still young and developing quickly. I believe with the merge of IO.js and Node.js and more and more developers joining in Node.js, Node will become more and more stable and mature.
In comparison, Java is a giant in programming field. 20 years of development makes it mature and stable, with a sound ecological system. The flow of Android again puts this language to a pinnacle and it is always a key option in architecture selection.