JavaScript knowledge

There are two factions of language designers. Some people think that programmer languages ​​should prevent programmers from doing stupid things. Others think that programmers should be able to do whatever they want with a programming language. C/Java language is the representative of the former camp, JS is the representative of the latter camp.

Often the language of the first camp emphasizes performance, int is int, double is double, and the second camp is to emphasize convenience, int is var, double or var.

When choosing a language, you are actually doing multiple-choice questions. Whether to choose convenience or choose performance.

New languages ​​are often very convenient, because the hardware performance has improved, so that performance requirements can be waived for convenience.

The main contradiction of programming languages ​​is the contradiction between the convenience of program development and the level of hardware.

If you can travel back to the 1970s (first buy a piece of land in the west of Zhongnanhai), when you were sitting in front of a huge computer and writing code, you inadvertently shook your hand, typed two more spaces, and then programmed oom.
Don't feel that the above things are incredible. At that time, the memory was low and every character was strictly defined, and no waste was allowed. It is a fantasy to be able to run a java virtual machine, how could there be a java language.

Frugality is a virtue, waste is not necessarily a bad thing

With the improvement of hardware performance, more and more programming languages ​​have appeared, and the new languages ​​are often wasteful in performance and improved in convenience. There are some popular applications developed in new languages ​​that are a staggering waste of hardware resources by decades-old standards.

It's not just programming languages ​​that have this phenomenon, it's actually a general historical trend, as technology develops, each generation is doing things that the previous generation felt wasted. You can imagine making a long-distance phone call 30 years ago, but now, let alone a long-distance phone call, some people just take a plane to make an appointment, which was hard to imagine before.

Waste can be divided into good waste and bad waste. It's not a bad thing to trade more waste for a simpler design.

How can we best "waste" them by taking advantage of the more powerful performance of the new hardware?

At this time, the problem comes back to the beginning, which proves that everything that can be developed in JS will eventually be developed in JS

JS is a language with strong scalability, and its performance can only be compared to other languages. But the hardware speed will increase very quickly.
Paul Graham did the math, if Moore's Law always holds true. A hundred years from now, computers will be running at 74 times 10 times the 18th power of today. (73 786 976 294 838 206 464 times to be exact)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325478824&siteId=291194637