home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
- From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
- Subject: Re: Handling of operator . pro
- Message-ID: <9222714.28203@mulga.cs.mu.OZ.AU>
- Sender: news@cs.mu.OZ.AU
- Organization: Computer Science, University of Melbourne, Australia
- References: <memo.565691@cix.compulink.co.uk> <9222523.7061@mulga.cs.mu.OZ.AU> <1992Aug13.014043.20561@ucc.su.OZ.AU>
- Date: Fri, 14 Aug 1992 04:38:15 GMT
- Lines: 64
-
- maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
-
- >In article <9222523.7061@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
- >>Also you have to learn the advanced feature every time you are maintaining
- >>code that used it, even if that code could have been written using only
- >>simpler features.
- >
- > I'm not so sure. Why is it harder to learn a properly conceived
- >language facility than to learn someones emulation of that facility
- >in reams of code? Sure you can read the code and deduce what it does,
- >but you are basically saying language manual writers ought to
- >write their manuals in C not english.
- >
- > [BTW: I sometimes think this!]
-
- One example is reference arguments. Without reference arguments, you know that
- a call like f(x) will not modify x [*]. In C++, even if YOU don't use reference
- arguments, you still have to check the declaration of f to be sure, because
- you don't know whether the writer of f did.
-
- [*] Sure, things are different for macros / array arguments, but
- the point remains.
-
- Here's another example: consider this hypthetical extension to C++ enum's.
-
- enum<<2 Bar { // better use an operator (<<) rather than a
- Fee, // keyword, to make things more confusing :-)
- Fie,
- Foe,
- Fum
- };
-
- Now this might be useful and convenient in some circumstances, but it adds to
- the complexity of the language and is yet another construct to remember.
- Instead you could just use standard C++ to achieve the desired effect, albeit
- slightly more verbosely:
-
- enum Bar {
- Fee = 0x01,
- Fie = 0x02,
- Foe = 0x04,
- Fum = 0x08,
- };
-
- Generally if a facility does provide a *large* reduction in the complexity
- of programs that need it, then it's not worth it.
-
- >>I shouldn't have said PL/1 (I have never learnt that language, I was just
- >>repeating what I have heard and read). Instead I should have said C++ :-)
- >>
- >
- > Some people complain about complexity of learning C++.
- >Bull. They have not traded off the advantages as compared to C.
-
- If there's one thing that C++ does well, then that thing is making C obsolete.
- For C++, the competition will come from languages that are more powerful
- yet less complex; as Bjarne has said, C compatability is C++'s biggest strength
- and also its biggest weakness.
-
- --
- Fergus Henderson fjh@munta.cs.mu.OZ.AU
- This .signature VIRUS is a self-referential statement that is true - but
- you will only be able to consistently believe it if you copy it to your own
- .signature file!
-