Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!hp4nl!media03!pkr From: pkr@media03.UUCP (Peter Kriens) Newsgroups: comp.lang.c++ Subject: Re: Casting downward Message-ID: <2352@media03.UUCP> Date: 3 Jun 91 08:14:14 GMT References: <675518012.11@sunbrk.FidoNet> <28468F0F.4444@tct.com> Reply-To: pkr@media03.UUCP (Peter Kriens) Organization: aQute, Netherlands Lines: 17 Chip Salzberg writes: > I take care in my C++ programming not to lose the static type of any > object for which I will need that static type later on. Obviously, > this means that I cannot use just one Array class, one Bag class, etc. > > It's better to be type-safe than to be convenient. Is there any research done validates this statement? As far as I can see there are pro's and con's for both methods. In the C++ language being typesafe means code duplication and handling a lot more cases. Resulting in a program with lots more lines of code and minimising reuse. Type safe means that you got your types ok, but not all the other 90% or mistakes you can make. So evenif it compiles, it probably doesnt run at once. So which one wins,lesser code ( is I assume lesser bugs) and more reuse, or the type safety? Peter Kriens