Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!dutrun!ben From: ben@duttnph.tudelft.nl (Ben Verwer) Newsgroups: comp.lang.c++ Subject: Re: Re: Variables sized objects Message-ID: <1040@dutrun.UUCP> Date: 18 Dec 89 16:27:35 GMT Sender: tnphnws@dutrun.UUCP Reply-To: ben@duttnph.tudelft.nl (Ben Verwer) Organization: Delft University of Technology, The Netherlands Lines: 31 This really makes me angry. A new language comes out. A book describing the language is written. You start to use the language in accordance with the book. On some pages optimalizations are advised, e.g. page 165, Stroustrup. "This implies that two allocation operations are necessary to create such objects on the free store and that every access to stored information will involve an extra indirection. (...) this is not necessary." You use the optimization. 3 years later a new version of the language comes out. Your "old" code does not compile anymore. You begin to suspect the worse and yes, Jonathan Shapiro writes: > (...) > First, this object cannot be built on a stack, because it's length > isn't known to the compiler. The semantic implications of a heap-only > object aren't clear. > Second, the implementation of such objects tends to be convoluted to > later readers. > Finally, the savings obtained tends to be *very* small. > (...) Optimization was useless, throw it out, too bad for the users... ----------------------------------------------------------------------------- Ben Verwer Lorentzweg 1 Pattern Recognition Group 2628 CJ Delft Faculty of Applied Physics The Netherlands Delft University of Technology +31(15)783247