
With the same style and clarity that characterized their highly acclaimed The Elements of Programming Style and Software Tools, the authors have written Software Tools in Pascal to teach how to write good Pascal programs that make good tools. The programs contained in the book are not artificial, but are actual tools that have proved valuable in the production of other programs. Structured programming and top-down design are emphasized and applied to every program, as are principles of sound design, testing, efficiency, and portability. All of the programs are complete and have been tested directly from the text. The programs are available in machine-readable form from Addison-Wesley. Software Tools in Pascal is ideal for use in a software engineering course, for a second course in programming, or as a supplement in any programming course. All programmers, professional and student, will find the book invaluable as a source of proven, useful programs for reading and study. Numerous exercises are provided to test comprehension and to extend the concepts presented in the book. 0201103427B04062001 Review: Excellent book, using it to learn software engineering - I had this book in my programming library and with some spare time I am implementing each program example from the text in Visual Basic 2010 console based applications, meant to use input output redirection and piping from the command line. There are mild problems with the program examples which are related to the authors using only UNIX systems for writing the programs in Pascal, like a CR is defined as 10 not 13, and is only one character, whereas in Windows a new line is a two character combination of a CR/LF. A new version of getc had to be written to deal with this, so even the very first example program to copy a file from standard input to standard output was flawed as it was written. However, in the last few days, I am finding I am able to learn a lot from the code in the book. It is easy to translate the structured control flow statements from the nonstandard Pascal used in the book to Visual Basic 2010, if you have a good VB textbook handy. The programs are meant to be run from the command line, so you have to know how to use Accessories to get to the command prompt in Windows. The chapters in the book cover simple programs like file copying, counting programs and getting rid of tabs or putting tabs in, then filter programs like a compare, compress, expand and translit program, followed by a files chapter with programs to include, concat, copy using file arguments and a powerful archive program. The next chapters deal with mainly one program per chapter, sorting, finding patterns in text, replacing patterns in text, a console based line editor and a simple formatter that can be expanded by adding additional commands. Using software metrics I have found that the programs are decomposed into routines of an average length of 66 words or 17 lines each and each routine takes me about 28 minutes to type in and test. I haven't found the program code on the Internet, despite it being on the Internet in the past. My main Pascal compiler on my computer is not compatible with the code in this book, especially in the file input and output routines. The choice of a string representation as an array of integers, starting at an index of 1 pervades the whole text, and using a different representation of strings makes writing the programs too difficult. I could translate all the Pascal control flow statements into VB except sets using "in" in Pascal. This I simulated with a boolean expression in an if then statement. The different stages of program design, development and testing are discussed about each program, not in specific chapters solely on design, testing or top-down design, however by implementing each program you learn quite a bit about these subjects from experience. I heartily recommend the book, rating it 5 out of 5. Review: It's Kernighan, so it's got to be good. - I have some nostalgia for Pascal. It's been fueled by finding that there is an old P-System (UCSD Pascal) for my ancient DEC Rainbow. So, picking up a couple of Pascal books was a must. I read through the Preface and it looks like an interesting book. It seems very useful for Unix style shell programs. The first part tend to be filters. Filters are great for short programs.
| Customer Reviews | 4.2 out of 5 stars 17 Reviews |
J**D
Excellent book, using it to learn software engineering
I had this book in my programming library and with some spare time I am implementing each program example from the text in Visual Basic 2010 console based applications, meant to use input output redirection and piping from the command line. There are mild problems with the program examples which are related to the authors using only UNIX systems for writing the programs in Pascal, like a CR is defined as 10 not 13, and is only one character, whereas in Windows a new line is a two character combination of a CR/LF. A new version of getc had to be written to deal with this, so even the very first example program to copy a file from standard input to standard output was flawed as it was written. However, in the last few days, I am finding I am able to learn a lot from the code in the book. It is easy to translate the structured control flow statements from the nonstandard Pascal used in the book to Visual Basic 2010, if you have a good VB textbook handy. The programs are meant to be run from the command line, so you have to know how to use Accessories to get to the command prompt in Windows. The chapters in the book cover simple programs like file copying, counting programs and getting rid of tabs or putting tabs in, then filter programs like a compare, compress, expand and translit program, followed by a files chapter with programs to include, concat, copy using file arguments and a powerful archive program. The next chapters deal with mainly one program per chapter, sorting, finding patterns in text, replacing patterns in text, a console based line editor and a simple formatter that can be expanded by adding additional commands. Using software metrics I have found that the programs are decomposed into routines of an average length of 66 words or 17 lines each and each routine takes me about 28 minutes to type in and test. I haven't found the program code on the Internet, despite it being on the Internet in the past. My main Pascal compiler on my computer is not compatible with the code in this book, especially in the file input and output routines. The choice of a string representation as an array of integers, starting at an index of 1 pervades the whole text, and using a different representation of strings makes writing the programs too difficult. I could translate all the Pascal control flow statements into VB except sets using "in" in Pascal. This I simulated with a boolean expression in an if then statement. The different stages of program design, development and testing are discussed about each program, not in specific chapters solely on design, testing or top-down design, however by implementing each program you learn quite a bit about these subjects from experience. I heartily recommend the book, rating it 5 out of 5.
J**N
It's Kernighan, so it's got to be good.
I have some nostalgia for Pascal. It's been fueled by finding that there is an old P-System (UCSD Pascal) for my ancient DEC Rainbow. So, picking up a couple of Pascal books was a must. I read through the Preface and it looks like an interesting book. It seems very useful for Unix style shell programs. The first part tend to be filters. Filters are great for short programs.
D**S
Better than the Ratfor version
An excellent exposition of building useful tools for whatever operating system. I was able to build the tools easily, as is, on Linux with Free Pascal, with only a few modifications to the example primitives. Kernighan does an excellent job sticking with the Pascal standard, and only using extensions when needed for I/O and command line arguments (buried in useful primitives). Standard Pascal has not changed since this book was written, (and most of Kernighan's criticisms of standard Pascal are still valid). This book is so much better than the Ratfor version. Pascal is such a simpler, more elegant language than PL/I and Fortran. Fortran has changed so significantly than the Fortran used in the original Software Tools, that there's no longer a need for Ratfor. In fact, I found the Ratfor tools easier to write in modern Fortran given the explanations in Software Tools in Pascal than the native explanations in Software Tools. Software Tools in Pascal is missing the subset Ratfor preprocessor, and the one-time-pad crypt utility, (which were in the Ratfor version). However, Ratfor is no longer needed (for Fortran or Pascal). As for the Ratfor crypt utility, it is useless on Windows, and even on Unix far better examples of cryptographic tools can be found in other texts for whatever platform. However, as a criticism, the text is laced with C-like primitives that in many cases were not needed, and made the programs more complicated. It also is very Unix centric in some of the assumptions of the tool designs. Though the include program and macro processor provided useful additions to a strict standard Pascal, they were also sometimes the wrong approach in retrospect. If new to Pascal, this book is actually a good starting point. Kernighan leaves nothing unexplained, has excellent bibliographic references at the end of each chapter, and introduces the Pascal syntax and data types within the text as needed. The overstrike command is an antique (see the POSIX asa utility, which makes a better design for the exercises), but most of the tools are still useful on modern systems. The purpose of this book is to teach how to build a portable toolset. It succeeds, and provides an entertaining, informative, and detailed read. Pascal was a good choice to replace Ratfor, and the book's timelessness shows. Pascal's shortcomings are easily resolved with, and the tools easily translated to, Modula-2 if a more modern language is desired.
S**T
Not recommended for the newcomer
Not recommended. For an experienced Pascal programmer the book can be quite an interesting read, more for the challenges it presents than the solutions it gives. Simply ignoring Kernighan and Plauger's code and developing one's own solutions can be quite entertaining. For the neophyte the problems are more daunting. Most programs in the book are line by line translations of the Ratfor programs in Software Tools(1976), not really Pascal programs but a kludge of Pascal statements forced to do something that, for Pascal, is unnatural. The book leads the novice down a not-so-primrose path and when problems are encountered the authors blame the language rather than their inept use of it. Case in point, in his 1981 rant Why Pascal is Not My Favorite Programming Language, Kernighan says "I simply gave up trying to write the following trivial encryption program in Pascal: i := 1; while getc(c) <> ENDFILE do begin putc(xor(c, key[i])); i := i mod keylen + 1 end because I couldn't write a sensible 'xor' function." Even in pre-standard Pascal the required xor is not particularly difficult to write, requiring less than an hour. If Kernighan cannot do it then is he really qualified to write a Pascal textbook? For someone learning the language today there is the additional problem that the book was written before the 1983 standard was published. Obviously this is not a fair criticism of the authors, even though they must have known that the standard was in the works. Nevertheless, it presents a problem for a modern reader who purchases the book and wants some hands-on work with the programs. He will likely be using Turbo Pascal, Free Pascal or some other implementation of the 1983 standard, for which the programs in the book are just plain wrong.
D**L
Excellent
Excellent book for learning programming, and building tools while building mindsets.
Trustpilot
3 weeks ago
4 days ago