Expert C Programming

(Jeff_L) #1

The problem is that you can't create any kind of new worthwhile text by cutting and pasting entire
paragraphs from other books. The level of abstraction is wrong. You can share text on the level of
individual words or letters (this corresponds to individual lines of code or characters), but the effort
involved in laboriously cutting them out is higher than the effort involved in deriving them afresh for
the new work. And in just the same way, software reuse at the library level has empirically turned out
to be less than originally envisioned.


There is a small number of special-purpose routines that can be and are shared: mathematical libraries,
a few data structure routines, and sorting and searching libraries. That's about it. These correspond to
diagrams or reference tables in a book, which can be lifted wholesale and understood somewhere else.


C++ may be more successful at software reuse than previous languages because its style of inheritance,
based on objects, allows data to be inherited as well as code. Ada generics allow this too, but the Ada
feature is cumbersome and too abstract for most programmers. To continue the analogy above, C++
makes it easier to check books out from the library, but you still have the problem of copying the
relevant parts sensibly.

Free download pdf