[ fromfile: preface.xml id: preface ]
C++ had been in use for many years before it was standardized in 1989, which makes it a relatively mature language compared to others in popular use today. It is an important language for building fast, efficient, mission-critical systems. C++ is also one of the most flexible languages around, giving developers many choices of programming styles for uses ranging from high-level GUI code to low-level device drivers.
For a few years in the early 90s, C++ was the most popular object-oriented (OO) language in use, and many computer science (CS) students were introduced to object-oriented programming (OOP) via C++. This was because C++ provided a relatively easy transition to OOP for C programmers, and many CS professors had been teaching C previously.
Starting around 1996, Java gained favor over C++ as the first OO language for students to learn. There are a number of reasons that Java gained so much popularity.
The language itself is simpler than C++.
The language has built-in garbage collection, so programmers do not need to concern themselves with memory de-allocation.
A standard set of GUI classes is included in the development kit.
The built-in String class supports Unicode.
Multithreading is built into the language.
It is easier to build and "plug in" Java Archives (JARs) than it is to recompile and relink libraries.
Many web servers provide Java APIs for easy integration.
Java programs are platform independent (Wintel, Solaris, MacOS, Linux, *nix, etc.).
Many of these benefits can be achieved with C++ used with Qt.
Qt provides a comprehensive set of GUI classes that run faster, look better, and are more flexible than Java's Swing classes.
Signals and slots are easier to use than (Action|Event|Key)Listener
interfaces in Java.
Qt has a plugin architecture that makes it possible to load code into an application without recompiling or relinking.
Qt provides foreach
, which makes iteration through
collections simpler to read and write.
Although Qt does not provide garbage collection, it provides a variety of alternatives you can use to avoid the need to delete heap objects directly.
Containers (see Section 6.8) that support reference counting and copy on write
Parents and children (see Section 8.2)
QPointer, and QSharedPointer, and QWeakReference (see Section 19.11).
Subobjects (see Section 2.14)
Stack objects (see Section 20.3)
Using C++ with Qt comes close to (and sometimes exceeds) Java in ease of use, comprehensiveness, and convenience. It significantly exceeds Java in the areas of speed and efficiency, making everything from processing-intensive server applications to high-speed graphics-intensive games possible.
Another benefit of learning C++ with Qt comes from Qt's widespread use in open source projects. There is already a great wealth of free open source code that you can learn from, reuse, and perhaps help to improve.
Part I contains the meat of the course: introduction to C++, UML, and Qt core, QObjects, Widgets, Model-View, SQL, XML, and design patterns. This part is designed to avoid forward referencing as much as possible, and it presents the topics in an order and a level of detail that should not overwhelm someone who is new to C/C++.
For completeness and for reference, Part II covers in more depth some of the "dry" but important C++ features that were introduced in Part I. By the time you have reached this point, these ideas should be a lot easier to understand.
At the end of each chapter, you will find exercises and review questions. Most of the programming exercises have solutions available to instructors on our Website. For the questions, if the answers are not in the preceding chapter, then often there are pointers on where to find them. If this book is used for a course, these questions could be asked by the student or by the teacher, in the classroom or on an exam.
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |