1.6. Notes About C++ and C++ for Programmers
Experienced C++ programmers
sometimes take pride in being able to create weird, contorted, convoluted uses
of the language. This is a poor programming practice. It makes programs more
difficult to read, more likely to behave strangely, more difficult to test and
debug, and more difficult to adapt to changing requirements. The following is
our first Good Programming Practice.
Good Programming Practice 1.1
|
Write your C++
programs in a simple and straightforward manner. This is sometimes referred to
as KIS ("keep it simple"). Do not "stretch" the language by trying bizarre
usages. |
You have heard that C and C++ are portable
languages, and that programs written in C and C++ can run on many different
computers. Portability is an
elusive goal. The ANSI C standard
document contains a lengthy list of portability issues, and complete books have
been written that discuss portability.
Portability Tip 1.2
|
Although
it's possible to write portable programs, there are many problems among
different C and C++ compilers and different computers that can make portability
difficult to achieve. Writing programs in C and C++ does not guarantee
portability. You often will need to deal directly with compiler and computer
variations. As a group, these are sometimes called platform
variations. |
We have audited our
presentation against the ISO/IEC C++ standard document for completeness and
accuracy. However, C++ is a rich language, and there are some features we have
not covered. If you need additional technical details on C++, you may want to
read the C++ standard document, which can be ordered from ANSI at
webstore.ansi.org
The title of the document is
"Information Technology – Programming Languages – C++" and its document number
is INCITS/ISO/IEC 14882-2003.
We have included an extensive bibliography
of books and papers on C++ and object-oriented programming. We also list many
websites relating to C++ and object-oriented programming in our C++ Resource
Center at www.deitel.com/cplusplus/. We list
several websites in Section
1.12, including links to free C++ compilers, resource
sites, some fun C++ games and game programming tutorials.