answersLogoWhite

0

The 10 Commandments of C++
  1. Thou shalt not rely on the compiler-generated methods for construction, destruction, copy construction, or assignment for any but the simplest of classes. Thou shalt implement these "big four" methods for any nontrivial class.
  2. Thou shalt declare and define the destructor as virtual such that others may become heir to the fruits of your labors.
  3. Thou shalt not violate the "is-a" rule by abusing the inheritance mechanism for thine own twisted perversions.
  4. Thou shalt not rely on any implementation-dependent behavior of a compiler, operating system, or hardware environment, lest thy code be forever caged within that dungeon.
  5. Thou shalt not augment the interface of a class at the lowest level without most prudent deliberation. Such ill-begotten practices imprison thy clients unjustly into thy classes and create unrest when code maintenance and extension are required.
  6. Thou shalt restrict thy friendship to truly worthy contemporaries. Beware, for thou art exposing thyself rudely as from a trenchcoat.
  7. Thou shalt not abuse thy implementation data by making it public or static except in the rarest of instances. Thy data are thine own; share it not with others.
  8. Thour shalt not suffer dangling pointers or references to be harbored within thy objects. These are nefarious and precarious agents of random and wanton destruction.
  9. Thou shalt make use of available class libraries as conscientiously as possible. Code reuse, not thine own but that of thy clients as well, is the holy grail of OO.
  10. Thou shalt forever forswear the use of the vile printf/scanf, rather favoring the flowing streams. Cast off thy vile C cloak and partake of the wondrous fruit of flexible and extensible I/O.

By Phin Straite, taken from "Practical C++ Programming".

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What does the ditloid 10 c mean?

ten commandments


Is the word commandments (as in the ten commandments) capitalized?

The phrase The Ten Commandments is capitalized. Otherwise, the word "commandments" is usually not capitalized, but sometimes is, depending on context.Other information:The Ten Commandments


Who is the actor that plays Moses in the ten commandments?

Anne Baxter


What is better the ten commandments or the code of Hammurabi?

ten commandments totally


What The ten commandments of tour guide?

ten commandments of tour guide


Who is Peter O'Toole in Ten Commandments?

Peter O'Toole was not in "The Ten Commandments".


How do you say Ten Commandments in Filipino?

The Ten Commandments in Filipino is translated as "Sampung Utos."


How many commandments were there before the Ten Commandments?

613 commandments.


How do you use the word ten commandments in a sentence?

I think you mean to use the words "Ten Commandments" in a sentence. Here are some examples.The Bible says that Moses was given ten commandments.There are ten commandments on that page.Our company rules have ten commandments we must obey.If you mean to list the ten commandments in sentences, I recommend that you read the Bible. They're listed in sentence form.


How much money did The Ten Commandments gross domestically?

The Ten Commandments grossed $80,000,000 in the domestic market.


Where was the ten commandments born at?

the ten commandments were given to moses at mount sinai


When was Ten Commandments for Drivers created?

Ten Commandments for Drivers was created in 2007.