APUE的一篇精彩书评

来自Amazon。好久没看到这么过瘾的技术书评了,呵呵,老外确实比较幽默。

Good reference in basic Unix API.
, September 26, 2001
Reviewer:"targeted" (Yellowknife, Canada)

This book seemed to be magnificent at first as it's big (700 pages), heavy and has a nice cover. And most of the text turned out to be great as well. But there were downsides.

From the first 14-15 chapters it seems like this is one of the best API references I saw. It's not just Unix, it's the way the author writes. He tells you what can be done, how exactly and what to watch for. Typical chapter can look something like:

---

Chapter 93. Cooking Eggs.

Eggs are one of the delicious and nutricious meals. Kitchenware provides the following functions to cook eggs:

egg_t eboil(egg_t egg, time_t time);
egg_t epanfry(egg_t egg, time_t time);
egg_t emicrowave(egg_t egg, time_t time);

All three functions take egg and time to cook and return egg. If time is 0 the egg is cooked until ready. If time is less than 0, it's cooked either for abs(time) or until ready whichever is less. Note, that only superuser can microwave an egg. Historically, these functions were written to operate with kitchen eggs only. Latest versions of Kitchenware add a function yolkctl(egg_t egg, bird_t whose) that you call with eggs before you pass them cooking functions.

Exercises:

1. Microwave an egg. What happened ? Explain why.

---

Well, this is just a few lines, whereas in the book it takes pages and pages of very detailed pedantic explanation. And this was great until approximately chapter 14, when the author started to put more and more sample code inline, in pursue of showing the functional working application or set of functions. This is one of the downsides (to me, if you like to dig through C code rather than reading plain text words - all the better). I think that a book like that should be a reference. The author does not show any algorithms and ideas anyway, so why bothering writing something big ? Give men a bricks and they will build the house themselves.

The other downside is also about the C sample code. As I said - the way Mr. Stevens writes text is very good. And the code is good as well, but not for a sample. In every single sample he is checking every possible error and not simply puts nice little trellis (...) where error handling should be, but actually handles them. Too pedantic and turns half of all the samples into calls to err_output or something. And at the very same time he uses custom header file (ourhdr.h) listed in appendix X, thus making it confusing to catch which is a new function you are reading about, and which is another auxiliary macro from that custom header.

One more thing - the book is basically all about <unistd.h> & Co, it does not tell anything about advanced libraries, like regular expressions, Berkeley DB or zlib. I guess that's why there are several more volumes of the same author.

The bottom line is, this book makes a good reference in basic Unix API.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值