Buy New

or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
Buy Used
Used - Good See details
$4.22 & eligible for FREE Super Saver Shipping on orders over $25. Details

or
Sign in to turn on 1-Click ordering.
 
   
More Buying Choices
Have one to sell? Sell yours here
C++ Programming Style
 
See larger image
 
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

C++ Programming Style [Paperback]

Tom Cargill (Author)
3.9 out of 5 stars  See all reviews (8 customer reviews)

List Price: $44.99
Price: $33.75 & this item ships for FREE with Super Saver Shipping. Details
You Save: $11.24 (25%)
  Special Offers Available
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
Only 9 left in stock--order soon (more on the way).
Want it delivered Tuesday, January 31? Choose One-Day Shipping at checkout. Details
Textbook Student FREE Two-Day Shipping for Students. Learn more

Formats

Amazon Price New from Used from
Hardcover --  
Paperback $33.75  

Book Description

0201563657 978-0201563658 July 10, 1992 1
C++ supports programming-in-the-large, allowing relationships between different parts of a program to be expressed. The scope of C++ programming style therefore goes beyond traditional in-the-small issues which relate to the details of line-by-line coding. This book examines the use of the in-the-large language features of C++, which sometimes confuse even experienced programmers. The author demonstrates that unwarranted use of the more powerful language features may lead to cluttered programs which are harder to comprehend and sometimes less efficient than more straightforward alternatives. Cargill rewrites several programs, using techniques that range from improving consistency to removing redundant inheritance. The presentation simulates a code review, in which readers may independently evaluate and criticize alternative approaches to programming problems, and then compare their analyses with those of the author. Design and coding style rules are distilled from the examples. Understanding and following these rules will help professional programmers design and write better C++ programs.A chapter is devoted to each of the following topics: *abstractions *operator overloading *consistency *wrappers *unnecessary inheritance *efficiency *virtual functions Building on the programming rules introduced in the first seven chapters, Cargill presents a case study in which a single program undergoes repeated transformations that improve its overall quality while reducing its size. The book concludes with a chapter on multiple inheritance. 0201563657B04062001

Special Offers and Product Promotions

  • Buy $50 in qualifying physical textbooks, get $5 in Amazon MP3 Credit. Here's how (restrictions apply)

Frequently Bought Together

C++ Programming Style + C++ Strategies and Tactics + Advanced C++ Programming Styles and Idioms
Price For All Three: $109.85

Show availability and shipping details

Buy the selected items together
  • In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details

  • C++ Strategies and Tactics $33.16

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details

  • Advanced C++ Programming Styles and Idioms $42.94

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details



Editorial Reviews

From the Inside Flap

Almost two decades after the publication of Kernighan and Plauger's classic, The Elements of Programming Style, its compact set of rules remains the best general guidance on good programming. Today, however, our programs are larger and our programming languages have changed. We now care as much about how the components of a program fit together as we do about the algorithms and data structures used in each component. DeRemer and Kron coined the terms programming-in-the-large and programming-in-the-small to make a distinction between the large-scale and small-scale aspects of programs. By programming-in-the-small, they meant dealing with components of a program that are "one to a few pages long" - the size of a typical C++ class. By programming-in-the-large, they meant the structuring of in-the-small components into a program - in C++ terms, dealing with relationships between classes. Kernighan and Plauger concentrated their work on the issues of programming-in-the-small. Their advice about programming-in-the-large is sound, but minimal.

Modularize. Use subroutines.

This book addresses programming style, with more emphasis on programming-in-the-large, and is restricted to the domain of C++ programs. It is written for the programmer who has learned the mechanics of C++, but is experiencing difficulty in applying the language features - particularly the object-oriented features - to programming problems. Though the discussion is limited to C++, many of the observations about programming are true of other languages. I leave the treatment of language-independent style in-the-large to more ambitious authors.

I have adopted Kernighan and Plauger's method of distilling rules of programming style from the critical reading and rewriting of programs. All the programs used here are taken from textbooks, magazine articles and tutorials on C++ programming. None was created artificially for this work. Some programs are presented exactly as originally published, while others have been altered cosmetically. The alterations range from the correction of in-the-small bugs, which would only distract, to structure-preserving transformations of programs for which copyright was not obtained.

The spirit in which to approach the material is that of an "egoless" code review. We all learn by reading and reviewing each other's programs. The material is not a criticism of individual programmers - it seeks only to differentiate between good and bad programs. No doubt the programs that are presented here as "better" versions have their own shortcomings. The reader is encouraged to examine these programs critically, looking for further improvements in programming style.

0201563657P04062001

From the Back Cover

C++ supports programming-in-the-large, allowing relationships between different parts of a program to be expressed. The scope of C++ programming style therefore goes beyond traditional in-the-small issues which relate to the details of line-by-line coding. This book examines the use of the in-the-large language features of C++, which sometimes confuse even experienced programmers. The author demonstrates that unwarranted use of the more powerful language features may lead to cluttered programs which are harder to comprehend and sometimes less efficient than more straightforward alternatives. Cargill rewrites several programs, using techniques that range from improving consistency to removing redundant inheritance. The presentation simulates a code review, in which readers may independently evaluate and criticize alternative approaches to programming problems, and then compare their analyses with those of the author.

Design and coding style rules are distilled from the examples. Understanding and following these rules will help professional programmers design and write better C++ programs.

A chapter is devoted to each of the following topics:

  • abstractions
  • operator overloading
  • consistency
  • wrappers
  • unnecessary inheritance
  • efficiency
  • virtual functions
Building on the programming rules introduced in the first seven chapters, Cargill presents a case study in which a single program undergoes repeated transformations that improve its overall quality while reducing its size. The book concludes with a chapter on multiple inheritance.



0201563657B04062001


Product Details

  • Paperback: 248 pages
  • Publisher: Addison-Wesley Professional; 1 edition (July 10, 1992)
  • Language: English
  • ISBN-10: 0201563657
  • ISBN-13: 978-0201563658
  • Product Dimensions: 9.2 x 7.4 x 0.6 inches
  • Shipping Weight: 1 pounds (View shipping rates and policies)
  • Average Customer Review: 3.9 out of 5 stars  See all reviews (8 customer reviews)
  • Amazon Best Sellers Rank: #621,106 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, read author blogs, and more.

 

Customer Reviews

8 Reviews
5 star:
 (2)
4 star:
 (4)
3 star:
 (1)
2 star:
 (1)
1 star:    (0)
 
 
 
 
 
Average Customer Review
3.9 out of 5 stars (8 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

10 of 10 people found the following review helpful:
4.0 out of 5 stars A Wonderful Surprise, August 15, 1999
By A Customer
This review is from: C++ Programming Style (Paperback)
I've understood the syntax of C++ and the basic ideas of OO for some time now, but I have not used these tools professionally because OO design is so hard, and I have little experience. I have often wished I had a book that would help me evaluate an OO design, and determine what its weaknesses were. This is that book.

I especially like the format; the author presents an OO class and then step by step tears it down and shows you what's broken about it. For each problem and its corresponding solution, the author presents a rule of thumb that can help you avoid similar design mistakes in the future. Some of the material is specific to C++, but a lot of it is applicable to any OO language.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


12 of 13 people found the following review helpful:
4.0 out of 5 stars Cargill's classic book on quality C++, September 22, 2002
By 
Amazon Verified Purchase(What's this?)
This review is from: C++ Programming Style (Paperback)
It is unfair to judge this book from the perspective of the "average" C++ programmer. Tom goes at least three steps further to treat programmers/readers as intelligent beings of the same species who already have the fundamental programming language "mechanics" skills. The reviewer who spewed forth about "coding style" really doesn't "get it." The whole issue of "where you put your braces" and naming conventions isn't what Tom or Tom's book is about. He already assumes that if you're programming C++ you have some idea of when you're going to press enter on the keyboard. (To make whitespace, in case you were wondering...)

The inferior thinking that confounds the world of programming is that C++ is an easy language to master. Very few programmers have much hope of aspiring to learn even 80% of the language and use it effectively. Thinking otherwise is like saying that everyone who wants to run a foot race can be Jessie Owens. Tom starts by treating readers as programming peers. That alone is an incredible benefit anytime programming is being done. Prima donas and those guys who always seem too busy to provide their "public interface" are the ones to avoid in learning anything of use regarding C++.

I pick up Tom's book every couple of months and browse it. His noted "brevity" is like a good RPG that gives subtle hints that incite thinking for yourself without following what many other books do by drawing a roadmap to one solution that worked for this one situation but may never again apply to anything useful. In my opinion, Tom's "lessons" are appropriately concise.

If you haven't read Tom's book, buy it, read it...if you're serious about your C++ skills. There is a *good* reason why Scott Meyers recommends Tom's book. It is something of a unique and interesting perspective on C++, which is really all that any of us can hope to give back to the language. The book is an interesting, insightful perspective that has pragmatic commentary that will help you be a better C++ programmer. At the last (ever?) C++ World conference in December of 1999, a discussion of which books to read evolved out of some other spew. Cargill's book came up as necessary reading, as it always seems to, for the simple fact that it comes from a respected industry professional with an uncany ability to boil out the meat of the topic without overcooking the stew. C++ is, at least, also an art form. Tom's ability with the art of C++ is inspiring. Scott Meyers is another artist. So is Angelika Langer and Herb Sutter, and Andy Koenig, Stan Lippman, Doug Lea and Erich Gamma and Jim Copelien and numerous others. But, for each of them, there are 10,000 very so-so programmers out there spewing forth complete nonsense. Help de-nonsense your world with Tom's book. One person indicated that it is somewhat stale. It is really like fine wine. It just gets better with age.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


5 of 5 people found the following review helpful:
3.0 out of 5 stars Informative but..., July 28, 2002
By 
Avneesh Bhatnagar (Ithaca, NY United States) - See all my reviews
This review is from: C++ Programming Style (Paperback)
I bought this book after reading through Effective C++ and More Effective C++ by Scott Meyers following the suggested reading by the author. I think that I should have read this book before purchasing the Effective C++ books. Basically it touches some fundamental issues, but due to the fact that it is slightly old, some topics such as templates are not covered very well. Meyers also gives a thorough overview of smart pointers, member function templates etc. My recommendation is that if you really want to start improving your C++ skills, forget about this book, read Scott Meyers' books and pick up Design Patterns by Erich Gamma and others.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews






Only search this product's reviews



What Other Items Do Customers Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 

Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums





Look for Similar Items by Category


Look for Similar Items by Subject