Technology and Trends
 USENET Archives
  
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site seismo.UUCP
Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!floyd!harpo!seismo!mo
From: m...@seismo.UUCP (Mike O'Dell)
Newsgroups: net.books,net.unix,net.unix-wizards
Subject: Review of Kernighan and Pike's New Book
Message-ID: <464@seismo.UUCP>
Date: Sun, 11-Dec-83 23:54:12 EST
Article-I.D.: seismo.464
Posted: Sun Dec 11 23:54:12 1983
Date-Received: Wed, 14-Dec-83 01:10:04 EST
Organization: Center for Seismic Studies, Arlington, VA
Lines: 111


	Review of "The UNIX Programming Environment" by
		Brian Kernighan and Rob Pike
		Prentice-Hall Software Series
		Copyright 1984 Bel Telephone Laboratories

		(Available in bookstores now, in spite
		 of copyright date.)

	Reviewer: Mike O'Dell
		mo@lbl-csam, lbl-csam!mo, seismo!mo

	
	"The UNIX Programming Environment" is book long overdue
and badly needed.  In this one place, you can find out "How to
Write Good" in the Unix world.  I recently saw a Letter-to-the-Editor
of some trade rag effusing over how the Pick OS is better than Unix
because in Pick you never have to write a program, while in Unix
you always have to write a program (distinct implication was "in C").
If there ever was a rebuttal to that miscomprehension, this book is it.

	This book spans an amazing range of topics: it contains
a VERY good upgrade of the "Unix for Beginners" chapter, and then
proceeds to demonstrate just how much work can be done on Unix,
even if the C compiler has been removed from the system.  The treatment
of shell programming (Bourne shell) is gradual and impressive.
It shows the sheer power and elegance of Unix, while at the same time,
not being coy about pointing out the occassional warts.  From simple
one-liners to embrionic SCCS-type tools, the reader learns the
skills necessary to truly exploit the powerful programming language
that is the shell. After mastering the shell, the discourse moves
to things which really need C, and how to write them well.
Design issues, coding hints, good practices, there is a wealth of
information here.  Starting with "cat" (Hello, Toronto!) which does
all (only?!) the right things without needing flags, to a full-fledged
interpreted programming language, here is a course in software
engineering using power tools, instead of hammer-and-tongs.
All along the way, things are built gradually, reusing previous pieces
instead of starting from a blank sheet of paper.  This book should
be read at the terminal, doing the exercises right along.

The reviewer has been thinking a great deal about the audience of this
book.  It is purest platinum for the programmer who while competent,
is new to Unix and the Unix world view.  Unix is a powerful environment
and learning to use it effectively and harmoniously can sometimes
go awry directly because the power and flexibility often make it almost as easy
to do things wrong as right. Moreover, most programmers, even and
especially many practicing Unix programmers, tend to think of solving
problems by writing programs.  This is to be encouraged; the problem,
however, is people often start writing in the wrong language (frequently
"C").    There are in fact many jobs which need programs to do them,
but if your view of "how to get the job done" isn't altered by
this text either you are already Genuinely Enlightened or you have
probably missed the point. (There are indeed sublte points along the way.)

While the book is well written and an interesting philosphical discourse,
there are points the reviewer differs with, and no doubt, any reader
will occassionally disagree with the authors.  But that too is valuable.
Thoughtful introspection is good for the soul, and gets one away
from the terminal as well.

Finally, I heartily commend this book to anyone wanting to Truly Know Unix;
it ain't perfect, but it is enlightening.  I particularly recommend
it to persons responsible for influencing the direction of the system
outside the BTL research group.  If you ever wondered about the 
"intent", you wil probably never see it spelled out as well
anywhere else.  Finally, anyone attempting to "enhance" Unix for
whatever reason or application should read this book. Before you
can enhance it, you have to know what is REALLY there and what
is NOT broken.


Annotated Top-level Table of Contents:

	1. UNIX for Beginners		
		Well re-written; deals well with the issue
		of local system conventions for erase, kill, etc.

	2. The File System
		What it does and doesn't do, and why that is important.

	3. Using the Shell
		Intro to Metacharacters, I/O redirection, pipes, etc.

	4. Filters
		grep, sed, awk and company

	5. Shell Programming
		Production-quality shell scripts
	
	6. Programming with Standard I/O
		Intro to the Standard I/O library ("C" obviously)

	7. UNIX System Calls
		Low-level I/O, processes, signals, etc.

	8. Program Development
		From a four-function calculator to an almost-Basic
		in 6 Easy Lessions
	
	9. Document Preparation
		Meet -ms and troff

	10. Epilog

	Appendix 1: ed summary

	Appendix 2: "hoc" manual page

	Appendix 3: "hoc" source code listing

Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!floyd!harpo!
seismo!hao!hplabs!sri-unix!beattie@mitre-gateway
From: beattie%mitre-gate...@sri-unix.UUCP
Newsgroups: net.unix
Subject: kernighan & pike book
Message-ID: <15862@sri-arpa.UUCP>
Date: Sat, 21-Jan-84 22:07:32 EST
Article-I.D.: sri-arpa.15862
Posted: Sat Jan 21 22:07:32 1984
Date-Received: Fri, 27-Jan-84 08:30:31 EST
Lines: 5

From:  brian beattie <beattie@mitre-gateway>

Could some-one give a short review of this book

beattie at mitre-gateway

Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site nsc.UUCP
Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!floyd!harpo!
seismo!hao!menlo70!nsc!chuqui
From: chu...@nsc.UUCP
Newsgroups: net.unix
Subject: Re: kernighan & pike book
Message-ID: <566@nsc.UUCP>
Date: Tue, 24-Jan-84 13:14:52 EST
Article-I.D.: nsc.566
Posted: Tue Jan 24 13:14:52 1984
Date-Received: Fri, 27-Jan-84 08:37:18 EST
References: <15862@sri-arpa.UUCP>
Organization: National Semiconductor, Sunnyvale
Lines: 56

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.

Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!decvax!genrad!grkermit!masscomp!clyde!floyd!harpo!
seismo!hao!hplabs!sri-unix!edhall@rand-unix
From: edhall%rand-u...@sri-unix.UUCP
Newsgroups: net.unix
Subject: Re: kernighan & pike book
Message-ID: <16035@sri-arpa.UUCP>
Date: Thu, 26-Jan-84 18:09:00 EST
Article-I.D.: sri-arpa.16035
Posted: Thu Jan 26 18:09:00 1984
Date-Received: Thu, 2-Feb-84 01:47:57 EST
Lines: 49

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)

Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!watmath!clyde!floyd!harpo!seismo!hao!hplabs!sri-unix!gwyn@brl-vld
From: gwyn%brl-...@sri-unix.UUCP
Newsgroups: net.unix
Subject: none
Message-ID: <16414@sri-arpa.UUCP>
Date: Sat, 4-Feb-84 23:06:14 EST
Article-I.D.: sri-arpa.16414
Posted: Sat Feb  4 23:06:14 1984
Date-Received: Thu, 9-Feb-84 02:49:38 EST
Lines: 43

From:      Doug Gwyn (VLD/VMB) <gwyn@brl-vld>

Here is a brief review of "The UNIX Programming Environment" by Brian
W. Kernighan & Rob Pike (1984, Prentice-Hall, ISBN 0-13-937681-X {PBK}).
(The authors work at Bell Labs and are well known to the UNIX community.)

This is the best book I have ever seen for UNIX programmers.  The
first few chapters can be read profitably by any intelligent first-time
UNIX user, but the book overall is targeted for professional programmers
who are encountering UNIX for the first time.  I must say that many old-
timers could learn something from this book, too.

The chapter titles are:
	UNIX for Beginners
	The File System
	Using the Shell
	Filters
	Shell Programming
	Programming with Standard I/O
	UNIX System Calls
	Program Development
	Document Preparation
	Epilog
with appendices
	Editor summary
	"hoc" Manual
	"hoc" Listing

"hoc" is an interpreter for a programmable calculator language, used as
a real-world example of program development.

This book is not just a description of features available on UNIX;
instead, the authors explain what is going on and why.  Anyone familiar
with "Software Tools" will recognize the approach.

Roughly half the book emphasizes the use of existing tools in shell
programs.  This is as it should be; it is perhaps the single greatest
contribution of UNIX to program development.

It is remarkable how little dependency on the particular version of
UNIX there is.  The few variations that matter are dealt with as needed.

I would recommend this book as THE book for all UNIX programmers.