home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- From: nikki@trmphrst.demon.co.uk (Nikki Locke)
- Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
- Subject: Re: Need help implementic data structures of generic objects
- Reply-To: nikki@trmphrst.demon.co.uk
- Distribution: world
- X-Mailer: cppnews $Revision: 1.30 $
- Organization: Trumphurst Ltd.
- Lines: 52
- Date: Tue, 15 Dec 1992 20:29:18 +0000
- Message-ID: <724476558snx@trmphrst.demon.co.uk>
- Sender: usenet@demon.co.uk
-
- In article <1992Dec13.002551.778@informix.com> cshaver@informix.com (Craig Shaver) writes:
- > Another tech weenie C++ bigot speaks out against Object Oriented Programming
- > methodology in general! (no :')
-
- No, the various C++ programmers who have replied to your rantings have
- merely stated that C++ is not the best language to implement a particular
- design, viz. heterogeneous collections.
-
- > This group seems to be biased against inheritance techniques in all cases.
-
- No, this group merely states that heterogeneous collections (and certain
- other things) are difficult to implement in statically typed languages
- like C++, because they are incompatible with static typing.
-
- > Matthew is going through the physics department of berserkeley, so I have
- > to assume we are dealing with a person of intelligence. That is unless
- > the night janitor has an interest in C++ class libraries.
-
- No-one was insulting Matthew's intelligence. I take it you are the night
- janitor at Informix :-) [ Sorry, couldn't resist. I'm sure you are highly
- intelligent really, it is just that your postings do not make it obvious ].
-
- > It is obvious to me that you have a virtual function in the base class for
- > all functions that you need to use when dealing with 'Objects'.
-
- This is the major problem with such systems - you end up with hundreds of
- virtual functions in the base Object, most of which will not be used
- (indeed, have no meaning) in a particular derived class. It can work, but
- it is not elegant C++.
-
- > If you use a function on a class that is only restricted to a certain
- > sub-tree of your inheritance structure, then you know what you are using,
- > ergo, you should have used that type instead of 'Object'.
-
- Correct. That is what everyone else is saying too.
-
- > So if you insist on making something more complicated than is needed and
- > you do not use good sense and good software engineering practices; it may come
- > back to haunt you.
-
- Precisely what everyone else is saying. Deriving everything from Object
- _is_ making things too complicated.
-
- And as for inheritance, in C++ it is for expressing an "is-a"
- relationship. Templates are for expressing genericity.
-
- [ Remind me to avoid the first few versions of any C++ class libraries
- that Informix come up with. Or was your disclaimer missing :-]
-
- --
- Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
- trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
-