[net.unix] kernighan & pike book

beattie%mitre-gateway@sri-unix.UUCP (01/22/84)

From:  brian beattie <beattie@mitre-gateway>

Could some-one give a short review of this book

beattie at mitre-gateway

chuqui@nsc.UUCP (01/24/84)

Speaking of reviewing the book, I have just finished it and was about to,
so without further ado:

*** The Review ***

The Unix Programming Environment
Brian W. Kernighan, Rob Pike
Prentice Hall Software Series, $19.95 (355 pages softcover)

For those that missed it, Rob Pike gave a talk at Unicom in Toronto on 'The
Philosophy of Unix Programming (or cat -v considered harmful)'. In it, he
discussed the pro's and con's of some of the trends he sees in Unix
programming and alternatives. He promoted very heavily the tool orientation
of small programs with single purposes put together in flexible ways. Two
programs he took to task were 'more' (for the very obvious reasons of
excessive functionality to the point on unmaintainability) and 'cat -v'
because it took a filter that moves information and modified it to be a
filter that modified information.

The book is an expansion of this talk, and describes in detail (with many
examples) how Rob and Brian feel Unix programs should be written. They
discuss shell programming and C programming in detail, and also look at
programs like sed, awk, lex, and yacc. There is some tutorial for all of
these, but the real audience seems to be programmers with Unix experience.

I was impressed with the talk at Uniforum, and I am even more impressed
with the book. I do NOT recommend it as a first book on Unix programming (I
much prefer the Bourne book for that), but it should be required reading
for every Unix programmer. There are a lot of good programs in the example
(such as vis, their replacement for cat -v, and p, their pager (with
filename spelling correction, no less, which you'll never find in a tty
driver (*hint*))). More than that, I found it showed me a lot about Unix
about Unix and how to use it efficiently (and if you believe their
philosophy, properly). I learned quite a bit about the shell (which doesn't
suprise me too much) but I also learned quite a bit about C (which did
suprise me, since I'm not exactly a C novice). There is a lot in this book
that I haven't seen elsewhere.

This book may not be for everyone. The people who like a few large programs
(such as more) are not going to like this book any more than they liked the
talk. I liked it a lot (if that wasn't obvious by now), but then my
programming tends towards their philosophy anyway. Either way, you should
read this book. 

On the chuqui scale: ***** (out of a possible 5)
	This book should be on everyones bookshelf. Congrats Brian and Rob
	for a good job very well done!


-- 
From the house at Pooh Corner:	Chuq (a Silly Old Bear)
				{fortune,menlo70}!nsc!chuqui
				have you hugged your Pooh today?
				Nuke the '58! Nuke the '58!

The difficult we gave up on yesterday, the impossible we are giving up on now.

GUNTHER.pa@PARC-MAXC.ARPA (01/26/84)

Did you receive any reviews?

-- Neil.

edhall%rand-unix@sri-unix.UUCP (01/27/84)

I expected someone else to comment by now, but since no one has, I'll
give you my two-cents' worth.

I've skimmed through the entire book and studied the introductory
chapter and bits and pieces scattered through it, so this isn't
meant to be a definitive review--just a first impression.

1) The book is pretty `meaty'.  It has some pretty sophisticated
examples (a calculator language that grows into a mini-programming
language is developed in later chapters), and the level of sophis-
tication expected seems about on a par with The C Programming
Language.  Not for neophytes to computing.  It has the effrontery
to explain YACC in a few pages and them proceed to *use* it.

2) It presents a lot of information.  The second chapter explains
the Unix filesystem: it not only *mentions* inodes, it goes over
in great detail what the various fields in the inode structure
mean.  In later chapters programs like AWK and SED are presented
in fairly good detail (enough, I would guess, to be useful, which
is more than I can say for the manual pages or most introductory
texts).

3) K&P aren't afraid to call a misfeature a mistake, or to present
a strong opinion, though they label it as such.  I find this
refreshing compared to the breathless praise some Unix books give.

4) This book is truest to the `Unix Philosophy' as I understand
it.  The concept of well-defined tools is presented and used
repeatedly. `Small is beautiful' philosophy is there but subdued.

5) I found the examples refreshingly uncontrived (or humorously
contrived).  The attitude I get is `this is serious business, but
not *that* serious'.

6) I would not hesitate to recommend this book to someone who was
already fairly knowledgable about computer systems and who has
good access to a Unix system (K&P reccommend reading the book
beside your terminal and trying things for yourself as you
encounter them).  But I think it might be a waste of money to
someone who does not have such experience.  It assumes a bit more
than the common introductory texts do.  Not an easy read, but not
a boring one, either.

'nuff said for now.  I'm sure other people will have more (and
likely better) comments as time goes on.

		-Ed Hall
		edhall@rand-unix        (ARPA)
		decvax!randvax!edhall   (UUCP)