How to rationally evaluate the merits and demerits of various programming languages?

Source: Internet
Author: User
I'm not looking for the silver bullet, and not the individual phper to lead the war, knowing that although there is a similar problem, PHP, Java, Python, C, C + + These programming languages have what characteristics or advantages? -C (programming language), but the inside is a lot of selling and chattering, did not see some as a beginner really want to know the question.

For example, PHP can be web development, but also for desktop development, but not the desktop software is developed in PHP, so the PHP language is actually more suitable for web development, this is a few comments on PHP. All speak of language is a tool, to use the right tool at the right time, do not understand the characteristics and how to use it at the right time? But understanding the characteristics of the language is certainly the people who have the experience to have a say, ah, I ask this question is to learn from the experienced population of these characteristics, learning. I really didn't mean to stir up a language fight.

Thank you to the small partners to answer ~ > _ < ~

Reply content:

First of all, there is no way to answer this question clearly, because the definition of "rationality" is not clear, nor is the term good or bad. I can only say my own point of view.

Here we recommend a Silicon Valley entrepreneurship godfather Paul Graham's article beating the Average, I hope you read it first.

As the Lord said, "PHP can do web development and desktop development, but not that desktop software is developed in PHP, so the PHP language is actually more suitable for web development, this is a few comments on PHP." "All common programming languages (General Purpose programming Language) are Turing equivalents, and there is no difference in computational power, but why don't anyone like to use Turing to make desktops, networks, or other applications?! Why don't everyone use the assembly?! Therefore, when arguing about the merits of computer language, it is only a low way to sacrifice Turing equivalence. But the computational truth is that all languages are equal power, so the problem is that we usually argue about what the hell we're arguing about when a language is more powerful than another language. Or is the new version of the same door more powerful than the older version, or more specific, with Lambda in Java 1.8, more powerful than Java 1.7? Java 1.5 introduces generics, is it stronger than 1.4? Python 3.5 is useful for async and await, so is Python 3.5 more powerful than Python 3.4? First of all, I think the new version is more powerful, the introduction of generics avoids some type errors at runtime, and Lambda lets the function not have to be shown to be wrapped in objects. Python's process frees up some control over the program flow. Then I also think they don't make the language more powerful, because the same features can be implemented in the old version, but it's a bit of a setback. however, butCan you use libraries to make up the generics introduced in 1.5? Obviously, it doesn't seem to work. So the characteristics can be divided into can be used to make up the library and can not use the library to compensate, I think this is 1.5:1.4 really strong, 1.5 is really better than 1.4, this point should be no controversy. But if Java 1.8 is better than 1.7, you can argue with me again, and I don't think the argument has any consequences.

so for the language is better, my definition is that language A's characteristics can not be used in the library of language B to compensate, then a language in this feature is better, if B can use the library to compensate for the characteristics of a, then a is more excellent can be controversial. I usually avoid or shelve this controversy.

So obviously, C language should be better than the assembly, first C language can define more types, structure, this is the assembly language library can not compensate, and secondly, C language has three kinds of control flow statements, order, conditions, loops (forget McCarthy or Dijkstra or Hall first proposed, You know, tell me about it. And you're a great assembler. The library is also unlikely to compensate for the syntactic advantages of the C language with if for while.

The following is a purely personal view:
So is Java more superior than C + +? Well,java has automatic memory recovery, C + + also out of the smart Pointer, the difference is only the cost of learning. In some other places Java also has some features that C + + libraries have no way to compensate.

is Java better than C language? There seems to be no large scale, and Java's object-oriented is just an abstract problem, and in C there are people who can also object-oriented programming. But there are some aspects of Java that are really better, such as the array index out of bound.

Is Haskell more superior than Java? The answer is yes. There are a bunch of features in Haskell that you can write less than hundreds of lines of code in Java.

This paper gives a paradox called Blub:
There is a programmer in blub language (imaginary language), which is a more powerful language than COBOL and assembler. Because for the assembly that's what the compiler wants. For COBOL, the Blub programmer does not know how COBOL programmers use COBOL to get things done, because COBOL does not even have a XXX feature, so the programmer does not use COBOL or assembler.

As long as this blub programmer looks down on other languages that are not as powerful as blub, this is not very powerful, because these languages do not blub the features that programmers are accustomed to using. And when they look up at more powerful languages, they don't think they're looking. What they see is a strange language (the author should refer to Lisp here) and think that Blub is as powerful as it is, but there is a bunch of strange things in it. Blub is good enough for him to think in a blub way.

This is the end of the paradox.
This may be the origin of the language dispute, the General people just do a relatively single job, as long as there is a language they are familiar with and good enough to go, at the same time, they have been accustomed to the language of the way of thinking. The latter is very frightening.

(Here's something else, someone asked a Chinese: why study?) Here's why and with a verb, we will think of a goal in inertia, such as reading for the rise of China. In order to go to St. unique knowledge, to open peace for the eternal, always have a goal. Why is it that the foreigner is using why? So some foreigners will answer this question "because knowledge itself is worth learning" this foreigner is Euclid, although he is Greek may not use English, but I just want to say that natural language will limit our thinking, not to mention computer language.

For example, in a language that is not recursive, the language you think about is always just a cycle of things, and in the assembly you will always think about what instructions you should use if you are doing that pile of registers. So you should jump out, break things you're familiar with, forget about it, and see Haskell, F #, Lisp, Scala, Scheme, Clojure, Ocaml, Erlang, the world's colourful. Haskell, F # I can cite a lot of features that you'll never be able to make up for in Java, C + +, C #. But that doesn't mean you have to use Haskell and F #, the only thing I don't want to see is that you specialize in C and C + + for years, and then spend a lot of time delving into go or python, because I don't think they bring you new ideas.

Finally, quote a sentence beating the average:
Everyone knows that it is wrong to use all of your programs to assemble handwriting, but few people notice a more general principle: If you can choose multiple languages, if most of them are the same, then if you do not have that strong is wrong.

There are, of course, exceptions to this principle. If you need to write a program to work with existing programs, then the new program is better than the original language. If you need to write a very simple program such as manipulating bit, then a language with less abstraction is enough, and it will be faster. If you want to write a short, and then discard the program, then you use the library is the most powerful, can help you quickly complete the work of the language. But for general applications, you'll want to use the most powerful (and efficient) language you know, and it's a mistake to use any of the other languages, such as assembly language. the following transfer from Wang Xiaobo's article: Working experience.
Source, Wang Xiaobo's book
Most of the silent novels read online
Text Working experience
I hope the boss of the software company will not learn the example.

When I studied in the United States, I played various odd jobs. One of them, I and Shanghai's old Cao to the home of the Chinese restaurant Decoration House. The restaurant's boss is a Shanghainese, rat, stingy, for the rest of his life as the chef, save a little money, own to open a shop, and a bit of burning panic-this pair of face is really ugly, with old Cao words, is a pair of red like. On the first day, he said to us: "I ask you both to save money, otherwise please old beauty." The project should be done according to my meaning. To use what tools, materials, to me, I go to buy. Don't try to wipe my oil ...

Previously, I knew that the United States of science and technology developed, business is also developed, but I do not know, the United States is also a variety of craftsmen of the country. We work on that street there is a big nest, what electrician, plumber, carpentry, and so on, and the decoration works of the small contractor son; When I heard that we had a job, we all ran to see. First look at us to swing a sledgehammer, hit the drill, face dew smile, and then ran to the back to find the boss, said: You please these two baby if in this century can decorate this restaurant, I lose you 100 yuan. I really Shing on my face, I want to throw a rod and not dry. But Lao Cao from his teeth spit mouth Spit said: Ignore him! This century is not finished, and the next century, anyway, the red man to pay us ...

As the saying goes, no diamond, do not hold the magnetic device live. It's our fault if we don't know how to decorate the house and take the job. Although I do not understand, but there is a strength to do a small job or qualified. Others old Zhou is the East Shanghai shipyard, is from the copper works promoted the engineer, specially decorate the cabin, decorate a restaurant still do not know how to do ... He always said that the urgent task now is to buy tools, rent tools, but the red boss always said, don't think freeloaders. Rather than be suspected of greed petty, it is better to work, earn some wages.

After the ground was knocked down, we won a certain degree of respect in this street. By the way, the hit down the cement block is a piece of me to carry out, thrown into the garbage box, the boss even a cart is reluctant to rent. He felt that he had already made artificial money, and then rented the tools to eat the loss. When the American craftsmen passed by, they always came to chat, and we were deeply impressed by our hard-worked spirit. But they say that life is not the way you two do it. To tell the truth, they all want to embrace this renovation project, but the price is not talked about. The next step is to tear down the old partition wall. I think it is very simple, swing a sledgehammer to smash-just hit a bit, the boss drink. He said it would spoil the wood in the wall. What wood is there in the partition wall, but some bits and pieces of junk wood. But the boss said it would be used to build the floor. So we took the nails out of the rotten wood on one root. The Americans met to ask what we were doing, I said truthfully, the other side cover the stomach to the ground squat, laughing in place to roll. This time even the old Cao's face can not hang on, straight blame me too talkative ...

Having finished the nails and bought a few new pieces of wood, the boss will try our carpenter's craft, let's make a door first. Cao used a saw under the material to: how I see, how to feel this saw is not like that, saw the wood to the straight corner. Why is it so different from the saw I've seen before? Was working, and came an American carpenter. He smiled and asked us what we had done. I was a college teacher before I went abroad, but I can't say that I can't lose my school face. Lao Cao's antecedents can not be said, said is to Shanghai East Shipyard disgrace. I said: we are artists. This is not all a lie. I published a novel before going abroad, as for Lao Cao, quite good at painting, works also participated in the Shanghai Workers Exhibition ... The old beauty said: I knew you were artists! I am secretly proud of: the artistic temperament of our body is so strong, they see it at one glance. Behold, he added, the workers did not work as you do! When the old beauty of the walk, Lao Cao dropped the saw, swearing up. The correct use of the saw was to saw the branches in the garden ...

We've been working for the Red boss for one months, and we've earned him hundreds of bucks, and the restaurant is not like a restaurant, it's not like a cold store, it's like a crappy stall. In the blink of an eye summer autumn come, we also should go back to school. The boss's face was getting ugly and he urged us to work overtime every day. Urge also no use, holding hammer iron bar in hand, fight life is also do not caller come. The American craftsmen on the street smelled the smell, gathered at our door and looked at us like abroad, and waited for the red boss to give them the project. In this case, even Lao Cao also stretched, finally and I quit work together. As a result, the project fell into the bosom of an American master like a ripe peach. Originally, after quitting the job, should go away. But Lao Cao also wants to see how the Americans work. He said that the project was useless, but not his fault, all blame the red man full stomach bad idea. If you do it by his means, you can let foreign devil see how the Chinese work ...

The United States contractor took the project, immediately split it out, to the electrician, carpentry, plumber, this morning is your, afternoon is his, the day after Tomorrow is mine, and so on. A few calls went out, and someone came to deliver the tool to the brim with a truck. These tools do not say I, even Cao has not seen. In addition to the electric saw planer, actually also has the use of the battery forklift, can be in the room to start, rinsed, and left our rags from the interior pushed out. Electrician on the electric lift platform, in the ceiling up and down the wire, the bottom of the carpentry in the assembly floor, skillful skill. Even though it is a ready-made component, it is too soon to admit that someone else is working. Installed after the electric plane a run, bright, finished immediately leave, take away machinery, new workers and machinery immediately open in ... In a twinkling, the restaurant will be a ... I and Lao Cao looked for a moment, and went away in a dingy manner. This is because we have all worked as workers and know how to work with dignity.
Now the young people really, what brain is not moving, want to be able to write paper level of knowledge, really do not know is that you are naïve good or intentioned good. In the school to fry homework, out of society to copy, a bunch of waste material.

To conform to rational evaluation, the evaluation of science is a kind of rational evaluation.
To be scientifically evaluated, it is only necessary to establish repeatable verification or experimental means.

The following are steps for a reference-only validation or an experimental method:

1. Choose a common, programmable problem to solve
2. Select the language measures, libraries, and so on that can be used in the candidate programming language
3. Invite programmers with enough intermediate or higher levels of programmer to write code within the agreed scope to solve this problem
4. Upgrade this issue or expand the scope of application of this problem

Iterate through the above steps to count the amount of code in each language that resolves the problem at each iteration (that is, when the problem changes).

Questions about candidate programming should be as close as possible to the issues that need to be addressed in the mainstream development environment.
---
It is another question as to what is the standard of language. The Economy of programming Languages Openclassroom
I don't think it's too rational for programming languages. First of all, the programming language is not what we can choose, and even if you can choose, but the choice is not much. Being a hobby doesn't have to be too rational. I personally actually prefer clojure, but there is no practical application scenario, if you do something, it will be used, but this period of work is very busy, there is no time to engage, but I really like the language.

In addition, I prefer the more flexible language, but do not have to deal with too much of the underlying details, such as Javascript,python,ruby. Hate those languages that need to deal with endless details, rules that are incredibly complex, and representative C + +.

The good language should be this: simple, reliable, flexible.
Features should include: Support functions also support object-oriented, highly flexible syntax, a huge class library, garbage collection mechanism, exception handling mechanism, advanced multithreaded model (such as actor), can use the least code to do the most things. In fact, it is only clojure to meet these.

But once I decide to use Clojure to develop our application, we face the dilemma of not being able to recruit people, this is XI ' an, not Seattle. I do not like to write code, so I need to use the things which language has been implemented, I use which language, cross-language development is not difficult generally I think, rookie support him because there is no need to learn too much, and the boss support him because many of his work needs rookie dry, that is a rotten language. This is the importance of reading history. The gene for each programming language is basically determined by the purpose of the design, although the day after tomorrow has an impact, but the change of the fish to make the bear's paw anyway is not as direct as to find bears to eat.

Last picture bar, slightly older, invasion delete.

I am very much in favor of Brother Bird's words:
Perhaps human nature is so, feel mastered the complex things will compare hanging, but they forget, or I just the point of view, language is just you learn to solve your practical problems, your ideas into practical tools, your growth should be you in the process of using them to solve problems, problem-solving experience growth, Rather than the growth of the use of language skills.
And also:
PHP programmers, need to seriously think about how your code will be executed, how you write code, the ultimate execution efficiency is highest. Rather than other languages, programmers can give a part of the optimization work to the compiler. In fact, the fundamental difference between the various languages is that the philosophy of thinking is different.
PHP is pragmatic, all with the simplest code to complete the main function, good development, good deployment, good update.
Python is extremely concise and strives to accomplish tasks efficiently with the most concise syntax.
Java is rigorous, syntax requires a variety of mandatory types, forced try catch and so on.
Other languages also have their own philosophy of thinking, in fact, after learning to a certain extent, will not conform to their own character of the language increasingly rejected, although will use, but will not like.
There are different applications in various languages, but the specific language used in the development of new projects is largely determined by the Director's preferences and the company's staffing, not what is more appropriate.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.