之前在2016年上半年书单里也提到过,学习C语言除了K&R的那本经典的《C程序设计语言》之外,还可以看看 Learn C The Hard Way 这个在线教程,更偏向实践一点。
最近终于把LCTHW刷完了,其中的代码都写了一遍,确实收获蛮多的。
我把代码放在了GitHub上,有兴趣的读者可以点击 这里 查看,或者直接git clone https://github.com/yubo1911/learncthehardway.git。
多说一句,作者在写完整份教程之后,在最后的一章 《Deconstructing K&RC Is Dead》 中可谓将K&R C批判了个体无完肤,这里摘录其中一段,大家自己感受一下:
And then I will also tell people to never write another C program again. It won’t be obvious. It won’t be outright, but my goal will be to move people right off C onto other languages that are doing it better. Go, Rust, and Swift, come to mind as recent entrants that can handle the majority of tasks that C does now, so I will push people there. I will tell them that their skills at finding defects, and rigorous analysis of C code will pay massive dividends in every language and make learning any other language possible.
But C? C’s dead. It’s the language for old programmers who want to debate section A.6.2 paragraph 4 of the undefined behavior of pointers. Good riddance. I’m going to go learn Go (or Rust, or Swift, or anything else).
我的看法是,C还依然是一门非常适用于造轮子的语言,而造轮子对于程序员具有无穷的(产品经理们、老板们、投资人们理解不了的)魅力。
但是直接面向业务的程序,还是选择能更快出活的语言和框架比较好。
另外,现在有很多语言/工具都是由C语言实现的,或者是在使用哲学上类似C语言的,那么掌握C语言,对于这一类技术就是一通百通的功效了。就像对于篮球运动员,拉杆变向、迷踪步欧洲步可以直接转化成得分,但是速度、力量训练还是要做的。
转载请注明出处: http://blog.guoyb.com/2016/07/23/learn-c-the-hard-way/
欢迎使用微信扫描下方二维码,关注我的微信公众号TechTalking,技术·生活·思考: