|
|
|
|
|
|
|
C++, perhaps more than other languages, demands that the programmer design the program before writing it. Trivial problems, such as the ones discussed in the first few chapters of this book, don't require much design. Complex problems, however, such as the ones professional programmers are challenged with every day, do require design. The more thorough the design, the more likely it is that the program will solve the problems it is designed to solve, on time and on budget. A good design also makes for a program that is relatively bug free and easy to maintain. It has been estimated that fully 90 percent of the cost of software is the combined cost of debugging and maintenance. To the extent that good design can reduce those costs, it can have a significant impact on the bottom-line cost of the project. |
|
|
|
|
|
|
|
|
The first question you need to ask when preparing to design any program is, What is the problem I'm trying to solve? Every program should have a clear, well-articulated goal; and you'll find that even the simplest programs in this book have one. |
|
|
|
|
|
|
|
|
The second question every good programmer asks is, Can this be accomplished without resorting to writing custom software? Reusing an old program, using pen and paper, or buying software off the shelf are often better solutions to a problem than writing something new. The programmer who can offer these alternatives will never suffer from lack of work; finding less expensive solutions to today's problems will always generate new opportunities later. |
|
|
|
|
|
|
|
|
Assuming you understand the problem and it requires writing a new program, you are ready to begin your design. |
|
|
|
|
|
|
|
|
C++, ANSI C++, Windows, and Other Areas of Confusion. |
|
|
|
|
|
|
|
|
C++ is a language. DOS, Windows, UNIX, and MacOS are operating systems. When you learn C++ you'll want to learn it as a portable language without regard to which machine and operating system you'll run your programs on. |
|
|
|
|
|
|
|
|
New Term: Teach Yourself C++ in 24 Hours makes no assumptions about your operating system. This book teaches ANSI C++. ANSI C++ is just another way of saying standard C++the internationally agreed-upon version that is portable to any platform and any development environment. |
|
|
|
|
|
|
|
|
Therefore, you won't see anything in this book about windows, list boxes, graphics, and so forth. All that is operating system dependent. You'll see output accomplished through standard output. |
|
|
|
|
|