Joxk

Joxk

However, the C++ language, similar to C, was designed for an experienced programmer. The
compiler does not try to second-guess the programmer, assuming that he or she knows what he or
she is doing. (And we do not always, do we?) It is important to know what we are doing. If the
developer is not careful, a C++ program can be quite complex and intimidating to a reader and
difficult to modify and maintain. Type conversions, pointer manipulation, array processing, and
parameter passing are also frequent sources of obscure errors in C++ programs.
Hopefully, sound software engineering practices recommended in this book will help you to
understand what you are doing and to avoid pitfalls of unnecessary complexity.
Summary
In this chapter, we looked at different solutions to the software crisis. The use of object-oriented
languages seems to be the most effective way of avoiding budget overruns, missed deadlines, and
scaled-down releases. However, writing programs in object-oriented languages is more difficult
than writing them in traditional procedural languages. Used correctly, object-oriented languages
facilitate the reading of a program, not the writing of it. Actually, this is very good. After all, we
write source code only once, when we type it in. We read code many, many times over¬°Xwhen we
debug it, test it, and maintain it.
As an object-oriented language, C++ allows you to bind together data and functions in a new
syntactic unit, class, which extends the concept of type. Using C++ classes, you write the program
as a set of cooperating objects rather than as a set of cooperating functions. Using classes promotes
modularization, and code design with high cohesion and low coupling. Classes support
encapsulation, class composition, and inheritance. This contributes to code reuse and
maintainability. The use of classes eliminates naming conflicts and contributes to understanding
code.
It is important to learn how to use C++ correctly. The...