[comp.lang.c++] Questions about class libraries and TC++

psmith@iies.ecn.purdue.edu (Paul F Smith) (03/19/91)

Please help!

I'm using Turbo C++ and beginning to maybe think about possibly 
writting some class libraries to sell. If anyone has some experience
and/or opinion to help me out I'd *really* appreciate it!

Here are my questions...

1. Should my class libraries be based on the Turbo C++ class library to 
minimize reinventing the wheel? Or should I just use the Turbo C++ library
as a model and make mine work without it?

2. Are the Turbo C++ class libraries actually AT&T's? Are they available
in *most* implementations of C++?

3. Are the Turbo C++ libraries any good, anyway? Or are they just good
examples?

4. Is there some standard class library that I *should* start with to make 
my libraries as re-usable as possible?

5. Is it possible to create a library that can be distributed and used
without requiring the source code to use it and/or derive classes from it? 
(Or should I just count on including the source?)

6. Are there any good books on creating class libraries for general use?

Thanks for the help!

--
------------------------------------------------------------------
Paul F. Smith - ADPC - Purdue University     psmith@ecn.purdue.edu

<someday I'll think of something profound to put here, maybe>

ahodgson@athena.mit.edu (Antony Hodgson) (03/20/91)

In article <1991Mar18.230519.10695@noose.ecn.purdue.edu> psmith@iies.ecn.purdue.edu (Paul F Smith) writes:
>
>1. Should my class libraries be based on the Turbo C++ class library to 
>minimize reinventing the wheel? Or should I just use the Turbo C++ library
>as a model and make mine work without it?
>
>3. Are the Turbo C++ libraries any good, anyway? Or are they just good
>examples?

There are several things I don't like about the Turbo libraries.  For one,
they decided not to overload operators to implement things like comparison
functions (e.g., isEqual() instead of ==, isLessThan instead of <, etc.).
They also seem to involve an awfully large amount of baggage which I find
I rarely need.  I've written my own list class from scratch and didn't
endow it with the ability to discover its own type (for example), but that
hasn't limited its usefulness at all.  The idea that everything should
descend from a common Object class at the top of the hierarchy is more
appropriate to SmallTalk than C++;  trying to enforce this practise makes
it very difficult to create classes which are easy to learn.  I would
advocate fairly minimal classes and allow others to derive classes with
broader functionality if that's needed (that's what multiple inheritance
is for, right?).
>
>5. Is it possible to create a library that can be distributed and used
>without requiring the source code to use it and/or derive classes from it? 
>(Or should I just count on including the source?)

Definitely, that's the whole point of inheritance.  Users, however, will
generally be pretty upset if you don't make source code available.
>
Tony Hodgson
ahodgson@hstbme.mit.edu