|
|
| |
|
|
|
|
Programming at Many Scales |
|
|
|
| |
|
|
|
|
To help you relate to the topics in this book, we describe in broad terms the way programming in its many forms is done in the real world. Obviously, we can't cover every situation, but we try to describe the state of the art. |
|
|
|
| |
|
|
|
|
Programming projects range in size from small-scale, in which a student or computer hobbyist writes a short program to try out something new, to large-scale multicompany programming projects involving hundreds of people. Between these two extremes are efforts of many other sizes. There are people who use programming in their professions, even though it isn't their primary job. For example, a scientist might write a special-purpose program to analyze data from a particular experiment. |
|
|
|
| |
|
|
|
|
Even among professional programmers, there are many specialized programming areas. An individual might have a specialty in business data processing, in writing compilers or developing word processors (a specialty known as tool making), in research and development support, in graphical display development, in writing entertainment software, or in one of many other areas. However, one individual can produce only fairly small programs (a few tens of thousands of lines of code at best). Work of this kind is called programming in the small. |
|
|
|
| |
|
|
|
|
A larger application, such as the development of a new operating system, might require hundreds of thousands or even millions of lines of code. Such large-scale projects require teams of programmers, many of them specialists, who must be organized in some manner or they waste valuable time just trying to communicate with one another. |
|
|
|
| |
|
|
|
|
Usually, a hierarchical organization is set up along the lines of the module structure chart. One person, the chief architect or project director, determines the basic structure of the program and then delegates the responsibility of implementing the major components. These components may be modules produced by a top-down design, or they may be classes and objects resulting from an object-oriented design. In smaller projects, the components may be delegated directly to programmers. In larger projects, the components may be given to team leaders, who divide them into subcomponents, which are then delegated to individual programmers or groups of programmers. At |
|
|
|
|
|
|
|
|
|
(text box continued on next page) |
|
|
|
|
|
|
|
|
The first two input operations use up the data in the file, leaving the third with no data to read. The stream inFile enters the fail state, so k isn't assigned a new value and the computer quietly continues executing at the next statement in the program. |
|
|
|
|
|
|
|
|
If the data file is prepared correctly and there is still an end-of-file error, the problem is in the program logic. For some reason, the program is attempting too many input operations. It could be a simple oversight such as specifying too many variables in a particular input statement. It could be a misuse of the ignore function, causing values to be skipped inadvertently. Or it could be a serious flaw in the algorithm. You should check all of these possibilities. |
|
|
|
|
|