Personal dialects and C++ overloading

brnstnd at stealth.acf.nyu.edu brnstnd at stealth.acf.nyu.edu
Wed Feb 14 14:41:17 AEST 1990


In article <1990Feb9.181111.24546 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
> In article <926.18:17:58 at stealth.acf.nyu.edu> brnstnd at stealth.acf.nyu.edu (Dan Bernstein) writes:
> >Overloading saves typing time. It has no other advantages...
> Sorry, I can't go along with that.  Saving typing time by itself is not
> of massive importance, but shorter programs are.

True. But do you really find that typing foo instead of library.foo (or
whatever your overloading language allows) makes your programs shorter?
Narrower, maybe, but that doesn't aid reading or comprehension.

> Operator overloading is desirable and useful, but placing some
> more constraints on it might be desirable.

Yeah. I probably wouldn't mind overloading if it had to have a special
syntax and if I could coax my editor into un-overloading (underloading?)
all overloaded operations. If Ada abbreviated lib1.lib2.foo as .foo or
lib2.foo rather than foo or lib2.foo, it might even be readable---the
initial period would serve as an ``overload warning'' and wouldn't be
too distracting. C++ doesn't have such simple syntax but the same idea
would work.

---Dan



More information about the Comp.lang.c mailing list