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

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

大家好,又见面了,我是全栈君,祝每个程序员都可以多学几门语言。

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.

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/118646.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • MessageDigest简要

    MessageDigest简要本文博客原參考文章:http://blog.sina.com.cn/s/blog_4f36423201000c1e.html一、概述java.security.MessageDigest类用于为应用程序提供信息摘要算法的功能,如MD5或SHA算法。简单点说就是用于生成散列码。信息摘要是安全的单向哈希函数,它接收随意大小的数据。输出固定长度的哈希值。关…

    2022年6月29日
    24
  • webpack版本区别_webpack和vue cli区别

    webpack版本区别_webpack和vue cli区别首先我们查看一下webpack的版本信息吧:现在已经更新到4.2.0版本了,理论上,我们可以选择任何一个版本,但是新的版本也不一定就是最好的选择,可能存在各种各样的问题,一旦出现了让人纠结的问题,解决麻烦还是挺浪费时间的,并且4.0以后的版本已经分离了webpack-cli,所以目前,无论是学习还是开发项目,我们可以先选择之前较为稳定的版本,个人还是用的3.0的版本;当然了,新的版本还是要测试着…

    2022年8月10日
    34
  • SQL datetime和smalldatetime区别

    SQL datetime和smalldatetime区别datetime存储大小8个字节,精确到分后的3为小数,日期范围从1753年1月1日到9999年12月31日;而smalldatetime存储大小为4个字节,精确到分,日期范围从1900年1月1日到2079年6月6日。参考http://msdn.microsoft.com/zh-cn/library/ms187819%28v=…

    2022年7月27日
    5
  • scrapy+xpath爬取不可描述网站[通俗易懂]

    scrapy+xpath爬取不可描述网站[通俗易懂]今天来爬一个让人很有动力的网站,网址就不便放上来了,看看有没有有缘人能得知了还是先来items.pyimportscrapyclassAvmooItem(scrapy.Item):#definethefieldsforyouritemherelike:#name=scrapy.Field()name=scrapy.Field()

    2022年6月14日
    39
  • bool函数

    bool函数bool函数:(非原创)BOOL是布尔型变量,也就是逻辑型变量的定义符,类似于float、double等,只不过float定义浮点型,double定义双精度浮点型。在objective-c中提供了相似的类型BOOL,它具有YES值和NO值。布尔型变量的值只有真(true)和假(false),可用于逻辑表达式,也就是“或”“与”“非”之类的逻辑运算和大于小于之类的关系运算,逻辑表达式运算结果为真…

    2022年6月14日
    41
  • MFC:进程间通信方式[通俗易懂]

    MFC:进程间通信方式[通俗易懂]windows下进程间通信方式:1、剪贴板(Ctrl+C;Ctrl+V)2、匿名管道3、命名管道4、邮槽/****************************************************************************************/一、剪贴板:voidCClipboardDlg::OnBtnSend()//向剪贴板中放置

    2022年10月11日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号