Make interfaces programmatic rather than semantic when possible. Each interface consists of a programmatic part and a semantic part. The programmatic part consists of the data types and other attribut...
Avoid duplicate code. Undoubtedly the most popular reason for creating a routine is to avoid duplicate code. Indeed, creation of similar code in two routines implies an error in decomposition. Pull th...
The automatic computer confronts us with a radically new intellectual challenge that has no precedent in our history. Of course software has become even more complex since 1989, and Dijkstra's ratio o...
Design Is a Wicked Problem Horst Rittel and Melvin Webber defined a wicked problem as one that could be clearly defined only by solving it, or by solving part of it (1973). This paradox implies, essen...
One of the most effective guidelines is not to get stuck on a single approach. If diagramming the design in UML isn't working, write it in English. Write a short test program. Try a completely differe...
One key to successful programming is avoiding arbitrary variations so that your brain can be free to focus on the variations that are really needed.
Even if you do a few things right, such as making high use of modern programming practices, you might still make a mistake that nullifies your productivity gains.
The underlying message of all these rules is that inheritance tends to work against the primary technical imperative you have as a programmer, which is to manage complexity. For the sake of controllin...
On their way to America, the Pilgrims argued about the best maximum length for a routine. After arguing about it for the entire trip, they arrived at Plymouth Rock and started to draft the Mayflower C...
On small, informal projects, a lot of design is done while the programmer sits at the keyboard. Design might be just writing a class interface in pseudocode before writing the details. It might be dra...
Use locking to control access to global variables. Similar to concurrency control in a multiuser database environment, locking requires that before the value of a global variable can be used or update...
Classes and routines are first and foremost intellectual tools for reducing complexity. If they're not making your job simpler, they're not doing their jobs.
Levels of Design Design is needed at several different levels of detail in a software system. Some design techniques apply at all levels, and some apply at only one or two. Figure 5-2 illustrates the...
Developers' estimates tend to have an optimism factor of 20 to 30 percent
Few people can understand more than three levels of nested ifs
Design is sloppy because a good solution is often only subtly different from a poor one.
Dijkstra pointed out that no one's skull is really big enough to contain a modern computer program (Dijkstra 1972), which means that we as software developers shouldn't try to cram whole programs into...
Global data is generally subject to two problems: routines operate on global data without knowing that other routines are operating on it, and routines are aware that other routines are operating on t...
Streamline parameter passing. If you're passing a parameter among several routines, that might indicate a need to factor those routines into a class that share the parameter as object data. Streamlini...
Here's a summary of when to use inheritance and when to use containment: If multiple classes share common data but not behavior, create a common object that those classes can contain. If multiple clas...
Showing 81 to 100 of 100 results