- Paperback: 168 pages
- Publisher: McGraw-Hill; 2nd edition (1978)
- Language: English
- ISBN-10: 0070342075
- ISBN-13: 978-0070342071
- Product Dimensions: 0.5 x 6 x 8.2 inches
- Shipping Weight: 8 ounces
- Average Customer Review: 4.4 out of 5 stars See all reviews (23 customer reviews)
- Amazon Best Sellers Rank: #470,210 in Books (See Top 100 in Books)
Enter your mobile number below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
Getting the download link through email is temporarily not available. Please check back later.
To get the free app, enter your mobile phone number.
The Elements of Programming Style, 2nd Edition Paperback – 1978
ITPro.TV Video Training
Take advantage of IT courses online anywhere, anytime with ITPro.TV. Learn more.
Customers Who Bought This Item Also Bought
Top Customer Reviews
It spells out, first with a counter example found in a piece of code published elsewhere and then with the code rewritten, over 70 pearls of wisdom that should be engraved into our consciousness; for many years every morning when I logged on to start work as a commercial Unix programmer one of these rules was randomly chosen as my message of the day, if I didn't understand the short rule I dragged out the book and refreshed my memory.
Brian Kernighan has co-authored three books almost essential to learning our craft, this volume, "Software Tools" and "The Unix Programming Environment". "Elements of Programming Style" spells out the fundamental rules, "Software Tools" shows you how to apply them to a number of simple projects and extends the rules to software design and finally "The Unix Programming Environment" shows you how to use them in an operating system designed to reward you for your effort.
The examples in either PL/I or Fortran expound the simple rules clearly and expertly in a manner typical of Kernighan's writing. That the languages used are old and most of the rules long accepted lore are not a drawback to this volume. Anyone who knows C, Pascal or even Perl should easily understand the code and programmers turn out code just as bad today in any number of languages.
These things make this book highly recommended reading for anyone who wishes to call them self "programmer." A final word of warning, don't lend this book to anyone, you'll never get it back - I've bought four copies so far.
Another set of rules from the book: "Make sure code and comments agree." and "Don't over-comment." Many programmers seldom do the first thing, resulting in widespread mismatches between the actual codes and surrounding comments. This applies to Java code as well. The comment style recommended by Java--that is, mixing code and comments that can be extracted into so-called self documentation--is an outright violation of the "don't over-comment" rule. (This is intended to be a criticism of Java-style comments.) Good code should document itself clearly; with perhaps a little help from judiciously added few comments that are not self-evident from the code itself.
The book uses FORTRAN and PL/I code examples. There are things that no longer apply today. But the fundamental rules and styles are still well applicable today and in the future.
The problem is that some of the FORTRAN and PL/I syntax are virtually unreadable to the modern programmer. Many of the examples and their lessons were still very clear, but others were almost impossible to parse. By the end, I probably learned enough FORTRAN in PL/I that I could go back and "decompile" most of the example programs. Additionally, many of the problems the authors describe at length were solved in C or C++, and more are absent in higher-level languages, and therefore likely inaccessible to newer students and more novice programmers. If someone were to write a "third edition" in C or C++ and swap some of the antiquated FORTRAN issues for modern C-and-C-like-language issues or even object-oriented issues, it could serve as a valuable, accessible guide for the current generation.
Despite these issues, I am inclined to give the book five stars, given my limited choices on a five-point scale. It is incredibly valuable, and will likely be one of the few I use for reference in the years to follow.
Most Recent Customer Reviews
All programmers should read it, and own a copy.
Examples are in Fortran, but they apply to any language.
This rounds out a collection of works by Kernighan. Each book of his covers a different aspect of software, in clear form with logical concepts. Read morePublished 13 months ago by Patrick S Malloy
TLDR: The Elements of Style + Brian Kernighan says it all.
The Elements of Programming Style is a classic programming book by Brian Kernighan. Read more
Just wanted this in my bookcase. No fun to read, nevertheless instructing.
COULD serve well as an introduction to beginning programmers IF they WOULD be able to decipher... Read more
I loved this when I was required to read it, and I've loved it every since. It if was in print or available on Kindle, I'd probably require my students to read it, too.Published on May 3, 2013 by Marcus Brown
This is still one of the best books on programming. In some ways much like the popular "Code Complete", but much more concise and clear. Read morePublished on December 6, 2011 by ctdean
A must read for programmers interested in making their code more accessible to others. Examples and tips are not language specific and easily applied to your project. Read morePublished on June 26, 2011 by Andrew Staats
The Elements of Programming Style, Kernighan and Plauger
The authors worked for Bell Telephone Laboratories in Murray Hill NJ, which is now out of business. Read more