Authors: David R. Musser, Atul Saini
Pages: 545
Publisher: Addison Wesley
ISBN13: 9780201633986
In 1968 Doug McIlroy presented his famous paper, "Mass Produced Software Components" (Ref. 6). Now, more than a quarter of a century later, we still have not fully realized his vision of standard libraries of reusable components (which today are also known as "software building blocks" or "software ICs"). In some areas such as numerical and statistical computation, there is a long tradition of heavy use of standard libraries, rather than writing source code entirely from scratch, but in many other areas, standardization hasn't occurred. Even in the area of fundamental data structures and data-processing algorithms, where there is perhaps the greatest potential benefit from component standardization and widespread component use, no set of components has emerged and been embraced by large numbers of programmers or software development managers.
In the absence of a standard set of such data structure and algorithm components, programmers have been forced either to program everything from scratch or to adopt one of several commercial packages. While writing everything from scratch often gives programmers a sense of control, it is also a source of frustration, since there is rarely time to implement the best techniques, even assuming they are already known to the programmer. And the available commercial libraries have suffered from several drawbacks. In the C++ realm, for example, the problems include
Incompatibility: The interfaces of classes supplied by various vendors are invariably different, making it difficult to write portable code.
Inefficiency: The implementations of most commercially available components libraries typically involve complex class hierarchies with extensive use of inheritance and virtual functions. As a result, using these components results in significantly less-efficient programs than could be written in C.
Unwieldy interfaces: In most component libraries, all operations to be performed on a data structure are part of the interface of the class defining it. Besides making it difficult for programmers to add new operations without recompiling the code, this makes the interfaces needlessly large.
These problems have been widely recognized for many years, but few solutions have been proposed and none has been widely embraced - not, that is, until now. The Standard Template Library is both a remarkable advance in programming methodology and a fully accepted part of the C++ Standard Library. It does not seem overly optimistic to expect that STL components will become some of the most widely used software in existence. The reasons are fivefold:
C++ is becoming one of the most widely used programming languages (which is in large part due to the support it provides for building and using component libraries).
Since STL has been incorporated into the ANSI/ISO standard for C++ and its libraries, compiler vendors are making it part of their standard distributions.
All components in STL are generic, meaning that they are adaptable (by language-supported, compile-time techniques) to many different uses.
The generality of STL components has been achieved without sacrificing efficiency.
The design of STL components as fine-grained, interchangeable building blocks makes them a suitable basis for further development of components for specialized areas such as databases, user interfaces, and so forth.
Virtually all C++ programmers know that the origin of this language is due to one person, Bjarne Stroustrup, who began thinking of how to extend the C language to support definition of classes and objects as early as 1979. So too it is the case that the architecture of STL is largely the creation of one person, Alexander Stepanov.