Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!umich!yale!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!stealth.acf.nyu.edu!brnstnd From: brnstnd@stealth.acf.nyu.edu Newsgroups: comp.lang.c Subject: Re: Personal dialects and C++ overloading Message-ID: <16334:04:32:49@stealth.acf.nyu.edu> Date: 16 Feb 90 04:32:49 GMT References: <5940014@hpcupt1.HP.COM> <33889@ucbvax.BERKELEY.EDU> <1922@gmdzi.UUCP> < <1990Jan29.210357.366@eng.umd.edu> <90029.194640JI8@PSUVM.BITNET> <4152@helios.TAMU.EDU> <926.18:17:58@stealth.acf.nyu.edu <4301@daffy Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein) Distribution: usa Organization: IR Lines: 34 In article <4301@daffy.cs.wisc.edu> schaut@cat9.cs.wisc.edu (Rick Schaut) writes: > In article <926.18:17:58@stealth.acf.nyu.edu> brnstnd@stealth.acf.nyu.edu (Dan Bernstein) writes: > | This Ada (and, by imitation, Fortran 90 and C++) misfeature makes > | program maintenance a nightmare. The problem isn't just that it's a pain > | to locate the routine that adds a GLORP to a FOOBIEBLETCH. The problem > | is that you won't even notice the nonstandard usage until it's too late. > > Any compiler that would allow you to apply the "+" operator to a "GLORP" > and a "FOOBIEBLETCH" doesn't conform to the notion of overloading. Say what? Why not? What if GLORPs and FOOBIEBLETCHen are natural candidates for addition? And since when does the compiler decide this for you? Read my comments in another article in this thread about how to make overloading readable. > | Overloading saves typing time. It has no other advantages. (Is it an > | advantage to be able to code without thinking and make undetectable > | syntax errors?) > Overloading saves having to think about the mechanics of calling the > correct procedure whilst allowing the programmer to think more about the > semantics of the program. The same would be true if overloading were distinctively marked, by an initial character, for example. This would save gratuitous syntax errors without being too distracting. Even so, are you sure that vector + vector means addition and not concatenation? Or are they character vectors, being used as strings? As many other programmers have pointed out, you should never force someone to learn a new language just to read a program. ---Dan