Effective C++ 3rd Edition
最近一个多月的业余时间都耗在了《Effective C++ 3rd Edition》这本书上。读的很辛苦,不仅仅是因为这是本英文书。之前答应了博文的编辑帮这本书写评注,将来用于出版。对于要印成白纸黑字的文章,不得不谨慎一些。
我已经有 4 年没有大段时间写 C++ 代码了。中间偶尔有几天写过几千行,其余的 C++ 经验就来至于 google reader 上的阅读。为了读这本书,我又重温了《C++语言的设计和演化》的几个章节。不过整个阅读过程还是不太赏心悦目。
可能还是因为我对 C++ 偏见过多,有如前几年对其的推崇备至。总觉得书里讲的太细,太多观点本是好的,只是局限在了 C++ 语言中。明明是 C++ 的缺陷,却让人绞尽心力的回避那些问题,或是以 C++ 独特的方式回避。在别的语言中不该存在的问题,却成了 C++ 程序员必备的知识。人生苦短,何苦制造问题来解决之。
可这也正映射了本书的主题:有效使用 C++ 。读下去,感觉能懂 Scott Meyers 了。我不相信大牛如厮,写了 10 多年一本书,就没有抱怨的。昨夜,读到 Item 25 ,关于对 std::swap 的扩展问题。109 页引申到特例化 std 名字空间里的方法时。一句“Alas, the form of the prohibition may dismay you” 尽显无奈。
我是上个月初去广州开会的旅途上开读这本书的。当时飞机晚点,在机场耽搁了四个小时。随身带的就这本书和一支铅笔。连同空中的时间,一共六小时。在书上做了几千字的记录。后来在新西兰,晚上边读边记。磨磨蹭蹭的读了几十页。当是把书越读越厚了。
如果不是为了完成先前百般推脱的这个任务,想来是不会这么有耐心的逐字读那些英文句子的。读的越细越发现没啥好评注的。要以我近年对 C++ 的态度。每篇只读个标题,估计就草草翻过了。都是 C++ 程序员必备的知识,还翻来覆去的讲个没完。剩下那些语法细节,属于语言工具相关的知识,不做 C++ 程序员本不必学习了。没太大启发。
结果,评注下来大部分都是对 C++ 的争议。稿子发给编辑看了。说是缺少一些对“初学者解惑和提速”的部分,而“批判固然是好的”,但比例也太大了。而且大部分页面空空,没落任何文字。
我也认为,无论怎样写下文章,都带有现实的局限性。或许过两年想法就变了。但文字印刷出来,就无法更改。如果有多余的精力,可能最后再来过一遍吧。想在出版时加上一篇免责声明,不要因我言论误导,而放弃学习 C++ 。希望不要因为我的评注,影响了书的销量 :)
btw. 如果仔细对比这本书的第二版(我前些年就是读的第二版,侯捷的中译本)和第三版,就会发现这简直是一本新书。
Comments
Posted by: 凄临雨 | (33) March 31, 2018 08:13 PM
Posted by: 无趣 | (32) July 20, 2011 11:47 AM
Posted by: 保健枕 | (31) December 19, 2010 03:00 PM
Posted by: frcsun | (30) December 4, 2010 09:41 AM
Posted by: sot | (29) November 15, 2010 03:11 PM
Posted by: 月下 | (28) November 6, 2010 11:51 PM
Posted by: 夏歌 | (27) October 26, 2010 03:27 PM
Posted by: Anonymous | (26) October 24, 2010 07:57 PM
Posted by: Siney | (25) October 24, 2010 01:32 PM
Posted by: 2b | (24) October 22, 2010 01:43 PM
Posted by: EGameSir | (23) October 22, 2010 12:41 PM
Posted by: keror | (22) October 22, 2010 11:42 AM
Posted by: Cloud | (21) October 22, 2010 11:21 AM
Posted by: Soli | (20) October 22, 2010 03:56 AM
Posted by: freeprogrammer | (19) October 22, 2010 01:45 AM
Posted by: nothanks | (18) October 21, 2010 06:41 PM
Posted by: 不孕不育医院 | (17) October 21, 2010 01:29 PM
Posted by: myan | (16) October 21, 2010 12:14 PM
Posted by: cy | (15) October 21, 2010 09:33 AM
Posted by: 赵中 | (14) October 20, 2010 05:08 PM
Posted by: lichking | (13) October 20, 2010 03:18 PM
Posted by: 百科 | (12) October 20, 2010 12:43 PM
Posted by: myan | (11) October 19, 2010 11:23 PM
Posted by: 赵建寅 | (10) October 19, 2010 09:06 PM
Posted by: mvply | (9) October 19, 2010 06:57 PM
Posted by: hqs | (8) October 19, 2010 06:12 PM
Posted by: 我是人类 | (7) October 19, 2010 06:03 PM
Posted by: avlee | (6) October 19, 2010 05:35 PM
Posted by: softtiger | (5) October 19, 2010 02:26 PM
Posted by: Anonymous | (4) October 19, 2010 02:06 PM
Posted by: Anonymous | (3) October 19, 2010 01:48 PM
Posted by: Anonymous | (2) October 19, 2010 01:21 PM
Posted by: 梁 | (1) October 19, 2010 01:19 PM