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)
上一篇 2021年12月3日 上午11:00
下一篇 2021年12月3日 下午12:00


相关推荐

  • webstorm 格式化代码及常用快捷键

    webstorm 格式化代码及常用快捷键webstorm格式化代码  快捷键 centOS下Ctrl+Shift+l windows下 Ctrl+Alt+lmac下Option+Command+l查找/代替快捷键 说明ctrl+shift+N 通过文件名快速查找工程内的文件(必记)ctrl+shift+alt+N 通过一个字符快速查找位置(必记)ctrl+F 在文件内快速查找代码F3 查找下一个shift+F3 查找上一…

    2022年6月12日
    72
  • 12864c语言程序,LCM12864 C语言驱动程序

    12864c语言程序,LCM12864 C语言驱动程序程序说明 LCD 驱动采用 4 位元 这个 4 位元方式 在网上搜索来看 还没有人采用 可以节省 4 位 I O 口 并口方式 晶体 4M 注意此 LCD 有点不同尽量很普通 没有 CS1 CS2 页选择脚 带串口方式 型号是 TS 12864 3 IC16F877A 在屏幕上

    2026年3月26日
    3
  • C# 解析 sln 文件

    C# 解析 sln 文件我的项目,编码工具需要检测打开一个工程,获取所有项目。但是发现原来的方法,如果存在文件夹,把项目放在文件夹中,那么是无法获得项目,于是我就找了一个方法去获得sln文件的所有项目。

    2022年4月28日
    42
  • 手把手喂饭版 | 教你用扣子搭建你的第一个AI Agent(智能体)!

    手把手喂饭版 | 教你用扣子搭建你的第一个AI Agent(智能体)!

    2026年3月12日
    3
  • [opencv] cvline cvcircle cvEllipse等画图操作

    [opencv] cvline cvcircle cvEllipse等画图操作1 cvlinecvLine image p1 p2 CV RGB 255 255 255 3 8 0 p1 p2 分别为起点和终点为 Tcvpoint 类型数据 3 表示线宽 8 表示线条类型 2 cvEllipsecvE image center size 0 0 270 CV RGB 255 255 255 3 8 0 center TCvPoint

    2026年3月16日
    2
  • c盘替换文件需要权限_windows安装命令

    c盘替换文件需要权限_windows安装命令大家都知道08权限的系统权限设置很严格,且在2003系统中常用到的溢出工具都失效。面对限制IP连接的情况我们及时拿到system权限有账号也上不去这种情况下只能弄shift后门或者放大镜了。但08权限在system权限也操作不了系统文件夹。先查通过whoami查看下登录帐号权限。通过下图我们看到是普通权限我用的到时MS12042这个大家都会用单独讲sysret.ex…

    2025年12月10日
    4

发表回复

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

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