- Paperback: 168 pages
- Publisher: McGraw-Hill; 2nd edition (1978)
- Language: English
- ISBN-10: 0070342075
- ISBN-13: 978-0070342071
- Product Dimensions: 6 x 0.5 x 8.2 inches
- Shipping Weight: 8 ounces
- Average Customer Review: 24 customer reviews
- Amazon Best Sellers Rank: #760,289 in Books (See Top 100 in Books)
Enter your mobile number or email address 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.
To get the free app, enter your mobile phone number.
The Elements of Programming Style, 2nd Edition 2nd Edition
Use the Amazon App to scan ISBNs and compare prices.
"Rebound" by Kwame Alexander
Don't miss best-selling author Kwame Alexander's "Rebound," a new companion novel to his Newbery Award-winner, "The Crossover,"" illustrated with striking graphic novel panels. Pre-order today
Customers who bought this item also bought
Customers who viewed this item also viewed
What other items do customers buy after viewing this item?
Author interviews, book reviews, editors picks, and more. Read it now
Top customer reviews
There was a problem filtering reviews right now. Please try again later.
"Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?"
People familiar with that statement -- it gets cited all over the place -- may be interested in looking at this book if only to see if there are any other gems inside. Chances are, the advice given may be a bit out of date in its particulars, but will have some persistent, deep, profound observations like the one above.
The authors worked for Bell Telephone Laboratories in Murray Hill NJ, which is now out of business. This critique of programming textbooks has no mention of what is taught in classrooms. The `Preface' says the purpose of this book is to educate the reader by example. Many textbooks on FORTRAN and PL/I provided examples. People who write programming language textbooks are seldom experienced programmers. [Why are there no examples in COBOL?] The authors don't mention the rationale for "good programming style". One author said "economy is the prime desideratum", but didn't distinguish between implementation (fast to build) or maintenance (fast to change because of clarity and comments). The best programming style is a program that works correctly. Next involves clarity or comments that explain what is being done. Descriptive labels are next (ACCTNO not A). Before the 1980s most programming involved printing statements that were typed onto punched cards. These discrete cards had an effect on organization (adding new code to the end of the deck via the GOTO statement).
The fragment of code on the top of page 3 is used to advise against branching around branches. Wouldn't a DO loop be better? [Its always easy to critique another person's code.] There are some who claim the fewer statements the better. But such coding may lack clarity. It's best for another person to review code to suggest where comments are needed (p.33). But management may not want to budget for this, and prefer to defer the costs to the future (see page 126). Making assumptions is human nature.
Chapter 5 lists "Common Blunders". An un-initialized variable is likely for a beginner. Page 135 says "choose variable names that won't be confused". A variable name should always differ by at least two letters to catch typing errors. The example in Chapter 6 totally omits taxes and other charges! But it is an academic exercise. It doesn't check if the hours are greater than 99 (which could not be a mistake if travel time is counted). A 5-digit employee number? No test of rates? Documentation is left for the last chapter. It is best to be first, every program should begin with an explanation of what is to be accomplished. [Does COBOL do this?] There is no guarantee the code will match the comments over time with changes by others.
The `Epilogue' says "good programmers" are those who have learned "good style". No, "good programmers" are those whose programs work perfectly and are delivered on schedule; they are also amenable to the changes that will occur over time. Being a good programmer does not ensure your corporation will stay in business or that you will continue to be employed. Programmers are only a cog in the machine and can be replaced by others at another site. This book is oriented to FORTRAN, the first successful computer language, which is used by a minority of programmers. This may explain the few reviews here.
[The pages refer to the original 1974 edition w/ blue cover.]
Their use of Fortran and PL/1 is hardly a problem. Any competent programmer should be able to read the examples easily and understand the point of the example. If it is a problem for you, I'd suggest you start with an easier book and build up to Elements of Programming Style. The style of which, by the way, is modelled after The Little Book aka Elements of Style by Strunk and White.
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
Examples are in Fortran, but they apply to any language.
The Elements of Programming Style is a classic programming book by Brian Kernighan.Read more
COULD serve well as an introduction to beginning programmers IF they WOULD be able to...Read more