这本书非常不严谨,初学者要当心了【附:我踩过的坑和过时的模块】
2017-02-03
任何一本技术书,只要仔细看,都能或多或少学到一些东西,值回票价,但是好书和坏书的差别在于,阅读学习过程中的流畅程度和喜悦感,这本书明显没有达标。
我猜想,大多数买这本书的人,都是node/express的初学者,希望通过阅读这本书来掌握node/express。
这本书的翻译不错,没有障碍,给出版社、翻译者、校对者点个赞。
但是这本书的问题,是英文原版作者的问题。
我个人不满意的地方有几点:
1. 涵盖内容宽泛但是不深入,提到了很多非必要的技术名称和知识点(mocha/chai/nodemon/grunt)但是又没有深入讲解,让新手无从下手,必要要借助其他工具来搜索+深入学习。
2. 我个人最讨厌的一点,代码命名前后不一致,11章之前用Product,然后到了后边,变成了vacation。
3.github上的代码,没法直接拿来就用,会报错,具体的坑自己体会。
4.全书说完之后,任然没有一个像样的作品,你可以发现通过学习这本书的代码,你搭建的东西其实没什么意义,而且不美观。
5.又发现一个恐怖的坑,package.json里面,每个章节中用到的模块版本不一样,大家可以比较一下11章和13章的connection的版本号,一个是2一个是3,看来。。。老外写的东西,也是坑一大堆,取决于作者的性格吧。
6.又发现一个过时的模块,connect-rest,只能用书中的版本,不能安装最新版本,详情:https://github.com/EthanRBrown/web-development-with-node-and-express/pull/86
后话#我个人很高兴能在春节期间,耐着性子先翻阅了一遍纸质书,然后对着书上的代码认真敲到编辑器里面,处理各种遇到的bug,因为国内能说道express.js 4 的书貌似就这一本,也没什么其他选择,听说有一本express in action,稍后我回去看看的。认真把一本书读通读透其实不错,可惜就是遇到了一个那么难啃的书...
还是那句话,任何书,认真看,或多或少都能学到东西,具体是这个过程是否愉悦。
这里附上美国亚马逊读者的评论:
《Provides good information, bad code examples》
I've been working along with the examples in this book and, while the book is informative, many of the examples don't work. This is problematic as future exercises rely on prior ones. In many cases this may simply be progress outpacing publishing: many of the examples use older or now obsolete versions of libraries or tools, not to be unexpected with relatively new technology. I've noted these problems on this book's O'Reilly errata page as descriptively as possible, as have many other readers.
Other than the problems with the code examples, this book does offer a good conceptual framework for developing for the Web using these technologies. I hope future versions work out the code example issues.