请问做web程序,nodejs真的比java 开发效率高吗?java的三大框架我很熟悉,我知道nodejs搭建一个能跑起来的web很容易,但一个应用程序不是搭建起来用的时间长短那么简单,还要看开发数据库连接是否方便,模块之间连接是否方便等。
伊谢尔伦2017-04-17 14:30:09
Anyone who talks about model selection out of the status quo is a rogue.
Selection depends on needs and developer.
I think what you actually want to know is the advantages and disadvantages of nodejs.
I’ll just talk about it
Advantages:
Based on javascript is its biggest advantage. This gives nodejs a large number of potential users.
nodejs is easy to learn. If you understand most of the knowledge about web development, you can quickly develop a simple web app by following tutorials and using appropriate frameworks.
Nodejs is based on the event system and developed for web development. It has advantages in io performance (in fact, it forces asynchronous programming).
Nodejs is very popular and the community (open source) is very active. (Related to 1 but not directly)
That’s what you said, the code density is high. Short code can complete the development tasks.
(from 4) Various libraries and frameworks are numerous, new and of good quality. Library to connect to database or something.
Disadvantages:
Nodejs is difficult to master. It’s not that ordinary people can’t do anything with nodejs, but because it is a dynamic language and requires high coding quality. Otherwise, you will fall into endless debugging.
CPU cost is high. Also because of dynamic languages.
Single process/process stability is slightly less stable. This can be easily solved with pm2, but it is also a disadvantage.
It is based on asynchronous, so there is something called callback hell, which will be ugly if written in es5.
怪我咯2017-04-17 14:30:09
First of all, this question is difficult to answer. In addition to the various conveniences provided by language, framework, and libraries, development efficiency also depends on proficiency. Comparisons at the language level using nodejs or java are meaningless. The language debate has never stopped!
迷茫2017-04-17 14:30:09
I have played express before when I had free time, and it felt pretty good.
Springboot can be used for rapid Java development.
In terms of speed, there are still many factors to consider, but generally speaking, scripting language development is faster.
黄舟2017-04-17 14:30:09
In fact, the difference between the quality of the language itself is not very big, it mainly depends on the person who uses it! People who know how to use it can write good programs in any language. If they don't know how to use it, they can't understand it in any language. There are pitfalls everywhere.
迷茫2017-04-17 14:30:09
Java has never been known for its development efficiency. Long project cycle is a common problem of Java Web.
When it comes to development efficiency, Node can only bow its head in front of PHP.
This is why it is the most PHP, a grassroots language with no background from a big company, is not favored but can thrive for a long time.
Simple and practical things will never go out of style. This is the hard truth.
This is why AngularJS, which has a background in Google, is still unable to shake it. Reasons for the jQuery ecology.
Even if those senior front-end advocates advocate that AngularJS is good, it will not help because the learning cost is high, the results are not obvious, and novices cannot play it, which undermines self-confidence.
And things like PHP+jQuery, It is very friendly to novices, and the in-depth function is also very powerful, which can help beginners build confidence.