Designing for Reuse
A C++ programmer can design code that both he/she and other programmers can reuse. This rule applies not only to libraries and frameworks that you specifically intend for other programmers to use, but also to any class, subsystem, or component that the programmer designed for a program. One of the a...
Saved in:
| Published in | Professional C++ pp. 1 - 2 |
|---|---|
| Main Author | |
| Format | Book Chapter |
| Language | English |
| Published |
Hoboken, New Jersey
John Wiley & Sons
2018
John Wiley & Sons, Inc |
| Edition | 4th Edition |
| Subjects | |
| Online Access | Get full text |
| ISBN | 1119421306 9781119421306 |
| DOI | 10.1002/9781119421276.ch6 |
Cover
| Summary: | A C++ programmer can design code that both he/she and other programmers can reuse. This rule applies not only to libraries and frameworks that you specifically intend for other programmers to use, but also to any class, subsystem, or component that the programmer designed for a program. One of the aspects of designing reusable code, providing ease of use, is more relevant to the interface design. In addition to abstracting and structuring the code appropriately, designing for reuse requires the programmer to focus on the interface with which programmers interact. This chapter provides some specific strategies for designing interfaces that are easy to use. It also presents specific tips for structuring the code: to avoid combining unrelated or logically separate concepts, to use templates for generic data structures and algorithms, to provide appropriate checks and safeguards, and to design for extensibility. |
|---|---|
| ISBN: | 1119421306 9781119421306 |
| DOI: | 10.1002/9781119421276.ch6 |