about NodeJS PHP Python Java Comparison of , Comparison and selection of programming languages
One of my projects uses these three languages , In fact, the simpler the procedure, the better , Can use a language, never use it 2 species ,but Why should I be so complicated ?
Every language has its disadvantages , The disadvantages of the time affect the effect , You have to work with other languages to be perfect , In other words, large systems are multi language , It's not big companies that have money to burn them , But the actual needs of different languages to complete !
1, What language do I want to use most php, Frame selection , Fast development , It will come into effect as soon as it is changed , however php There are also a lot of disgusting places , Call the system command ,linux The problem of system permission is very serious , In order not to use other languages ,php make a system call shell What should I do? ?
use c Language writes a program , Compile to binary linux Executable program , Give the program root jurisdiction , And then write another one shell file , Give Way c Program call shell
, Last but not least php call c Program to implement root Authority execution shell Document code capability , The whole process is complicated , Very uncomfortable .shell yes linux System native language , Must be used at the control system level , Although its grammar and windows
Of bat Batch commands are just as disgusting , But you can't deal with systems without him , Take it .
summary ： Working with systems php It's a hell of a struggle , It's just incompetent .
2,php There is no image java Like that application This global variable , So you have to write a file with , cache , Database to share global variables , To achieve global control , This is extremely disgusting , in other words php No global caching capability , Half waste , Global functionality is very important . although php A lot of plug-ins , But it's still weak .
3, You can't control everything http request , what do you mean ? for example ,10 personal visit php, Everyone's process is independent , No way 10 Individuals conduct a unified management and feedback .
These three shortcomings ,java,python and nodejs Can be done , No plug-in is required . So I was forced to choose python coordination PHP, therefore python It's obvious , It's omnipotent , The system program can be developed ,web Websites can also be developed , The ability to mix it all up , Pure omnipotent language .
nodejs and python equally , It's a new language , It's all powerful . actually java It's omnipotent, too ,java It's also powerful , But I don't like it java The reason is that it is too rigid and rigorous , But his rigor also makes it suitable for large programs , First class stability , It's fast , But the development speed is not good , It's too strict and too wordy , The framework is huge, too , however java It's a top student , Ability not to say , It has a wide range of applications , Like Android development java, More with one stone , therefore java It's excellent , learn java No loss , But do you like it , It depends on personal preference , I don't like it very much , I like the faster the development, the better , I don't do any big systems .
later , Why did I add another one nodejs language , Is it neuropathy ? no , It's really forced again , even python It's not easy to use .
python Of web Poor service performance php fast , Do the same website php Fast access , therefore php stay web The field is not an empty name , Fast development , Fast response !
however php Not as fast as java web
Fast , If the same lightweight framework ,java Compiled into class After the speed ratio php Fast , It is , because php It's a scripting language , It needs to be translated into machine language every time , and java Bytecode translation speed is much faster , Closer to machine language , therefore java It makes sense to be quick .
web Interface , High concurrency web Interface ,nodejs than java,php,python It's much faster , Not a little bit fast , It's dozens of times faster , This is very important in practical application , Especially the interface response speed , Because according to the expected function , use php Developed , The interface response does not meet the requirements , What to do without adding servers ? use python Development is slower , use nodejs Try it , Sure enough, it's much faster , The effect is obvious
, Why? ? because nodejs Of v8 The engine is used by Google chrome The speed on the browser is very fast , Why chrome Will become a black horse in the browser industry ? That's why v8
, Lightweight and fast enough ,nodejs It's used .
Words ,php and python It can be realized IO Asynchronous mechanism , However, the scheme is immature and non-native support , It's going to be a lot of trouble to deal with it yourself , All changes can not be separated from Qizong , Any language is a representation, right , It's all about encapsulation of machine language , Based on cpu And memory and other hardware mechanisms , That's it , So any language can do the same thing , But can not exceed the computer hardware operating system rules .
therefore , because nodejs The advantages of concurrent response choose it . So my program uses it 3 Languages ,php,python,nodejs,shell, There was another one before c Language by python Instead of , actually python No more ,
php,nodejs,shell That's enough .
The final conclusion ：
Which language do you use , It's not what we can say , It depends on what function you need , Which language is the fastest to program , Fastest response .
1,php Suitable for front-end interface UI layer , Normal response level webservice Interface for and mysql Database access , The frame becomes fast and simple enough .
2,nodejs Fit to do IO Dense , Concurrent demand ,CPU Less calculated , Interface class .
3,python In fact nodejs Also basic ok, therefore python It doesn't work very well , however python It is very advantageous in class libraries such as artificial intelligence , Big data crawlers and other fields are too convenient , Maybe python There are a lot of gods , It's a lot easier for us to stand on the shoulders of giants , therefore python The class library is powerful and advanced , Language itself is omnipotent , The development speed is also very fast , It's also because there are too many class libraries .
Many people make complaints about it. python Code schema must use spaces or tab indent , I want to make complaints about it. , Is this necessary ? The only advantage is that the code is neat , Forced .
4,java, The most popular language today , It's been going on for years , It's really powerful , Wide range of applications , almighty , There are also many plug-ins , It's kind of like the elite of human society .