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...

Full description

Saved in:
Bibliographic Details
Published inProfessional C++ pp. 1 - 2
Main Author Gregoire Marc
Format Book Chapter
LanguageEnglish
Published Hoboken, New Jersey John Wiley & Sons 2018
John Wiley & Sons, Inc
Edition4th Edition
Subjects
Online AccessGet full text
ISBN1119421306
9781119421306
DOI10.1002/9781119421276.ch6

Cover

More Information
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