首页 > 编程语言 > 详细

Do we need other languages other than C and C++?

时间:2014-08-15 14:08:18      阅读:408      评论:0      收藏:0      [点我收藏+]
There were hundreds of or thousands of programming languages created since the invention of computer. All these languages have the same target which is to make the computer do what we want it do. So we may find that many languages have the same functions, i.e, one task can be completed by one language can be completed by another language as well. Now we may wonder why we need so many different languages. Can we just have C or C++ since they provide the best performance we need. The answer obviously is no.

We do need other languages other than C and C++. Here are the reasons.

The creation of different languages has its own historic reasons. For example, when in 70s, the memory in a computer was limited and the CPU speed was not fast enough, to make a program workable and with an expected performance, we have to create a language which takes relative little memory and at the same time does the job we assign to it, with these reasons, we have C/C++ created. Later, the performance of CPU and the capacity of memory increased, we can achieve the same performance even with a relative slow language such as Java. Also, it‘s easier to learn and can help us reduce some mistakes which made by C/C++ programmers frequently --memory leaks.

Computers have reached a point where even "slow" languages run fast enough to make the difference in speed irrelevant in many cases. We have the luxury now of sacrificing some potential performance to use a language that offers better first-class features and more powerful abstractions, which is important because it lets us get more code out the door in the same amount of time. On average, ten working but not-quite-optimized apps will do more total good than two working and really fast ones.

Most programs aren‘t performance-critical. As long as the code is reasonably written, most people won‘t notice the difference between something written in Python and some optimized code in C++. If you‘re having performance problems and need to speed something up, the biggest gains will come from improving your data model or moving your code into a better complexity class. Only in rare cases, like search services or high-frequency trading, will removing the relatively small penalties from things like language speed actually be worth the cost.

Different languages have different use. Some languages are created for special purpose. They can provide some specified functions or libraries which are not needed in other general languages. For example, you can use MATLAB to do many things related to signal processing including audio, image etc. These audio and image processing requires a whole different set of functions. One another example is Erlang which is created with concurrency in mind. As current computer has more than one processor, we can let the computers do different things at the same time.

Make it quickly, make it great, make it fast enough to use, and ship it. Anything past that is rarely a good use of your time.

Do we need other languages other than C and C++?,布布扣,bubuko.com

Do we need other languages other than C and C++?

原文:http://www.cnblogs.com/yxwkf/p/3914605.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!