技术控

    今日:147| 主题:49136
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] The cost of forsaking C

[复制链接]
夏日落傷 发表于 2016-10-5 09:15:43
98 2

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
The C programming language is not trendy. The    most recentedition of the canonical C text (the excitingly named    The C Programming Language) was published in 1988; C is so unfashionable that the authors have neglected to update it in light of 30 years of progress in software engineering. Everyone “has been meaning to” learn Rust or Go or Clojure over a weekend, not C. There isn’t even a cute C animal in C’s non-logo on a C decal not stuck to your laptop.  
  But Myles and I are not trendy people, so we insist that all of our students become fluent in C. A fresh class of C converts has just finished working through the K&R bible, making this a good time for me to reflect on why we deify this ancient tongue.
  We give students four reasons for learning C:
  
       
  • It is still one of the most commonly used languages outside of the Bay Area web/mobile startup echo chamber;   
  • C’s influence can be seen in many modern languages;   
  • C helps you think like a computer; and,   
  • Most tools for writing software are written in C (or C++)  
  The first is easy to dismiss if one    likesthe Bay Area web/mobile startup echo chamber, the second if one    hatesC’s influence on many more modern languages. Most engineers should take head of reason three, although our students also learn computer architecture and at least one assembly language, so have a firm mental model of how computers actually compute. But reason four is hard to ignore.  
  Forsaking C means forsaking anything below the level of abstraction at which one happens to currently work. Those who work for instance as web developers forsake thoroughly understanding the browsers, operating systems and languages on top of which their own work stands.
  Concretely:
  Most of our students use    interpreted languages with popular implementations written in C. One exercise we do is to write a Python bytecode interpreter to better understand stack machines and interpreted languages; doing so involves reading the CPython implementation closely. The ruby reference implementation is also written in C, and most JavaScript implementations are written in C++.  
  When learning about    common data structuressuch as hashmaps and dynamic arrays, we need to either implement these ourselves in a language where we can think concretely about memory layout, or to read good implementations that do so. For a student to understand how a Python list or ruby array works, we have them either write a version from scratch or read the source of the standard library implementations—gaining the same level of understanding without diving into C is almost impossible.  
  Learning about    operating systemswould be much harder without C. The operating systems that we use are mostly written in C, the C standard library is tightly coupled to the syscall interface, and most resources dealing with operating systems concepts assume knowledge of C.  
  While it is certainly possible to learn about    computer networkingwithout being fluent in C, practitioners who need to understand    their operating system’s TCP/IP stackwill find themselves grasping for C.  
  Lastly most of the work we do with    databases, key value stores, message queues and other distributed systems technologiesmandates C, for performance reasons.  
  Many practicing software engineers do fine work without fully understanding the above. Routine work in a narrow domain may not demand foundational knowledge. But our students strive to do novel, high-impact work, and quickly find that a solid understanding of C is a prerequisite. If you have similar goals, I would encourage you to put aside that trendy new language for a few more weekends and brush up on good old C.
友荐云推荐




上一篇:[译] 机器人可以如何通过共享经历学习新技能
下一篇:How I test Ansible configuration on 7 different OSes with Docker
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

帅帅 发表于 2016-10-5 10:29:48
内容很有深度!
回复 支持 反对

使用道具 举报

何宇航 发表于 2016-11-17 20:31:03
介是神马?!!
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2016 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表