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.