[Gllug] Office software -> c/c++ debate
Nix
nix at esperi.demon.co.uk
Sat Nov 17 22:14:31 UTC 2001
On Sat, 17 Nov 2001, Pete Ryland stipulated:
> On Sat, Nov 17, 2001 at 04:43:57PM +0000, Bruce Richardson wrote:
>> On Fri, Nov 16, 2001 at 03:26:42PM +0000, Pete Ryland wrote:
>> > C++ is a superset of C.
>>
>> Some C code is not valid C++, so that is not strictly accurate.
>> Objective-C was specifically designed to be a superset of C and so to
>> compile all C code. It's supporters also cite the simpler O-O model as
>> an advantage.
>
> oh ok, I always saw it as strictly a superset. [off topic?] What sort of
> stuff is not downward compatible?
See appendix AA to the C++ Standard, [diff.iso] (I think it was still
called that when the Standard proper was published, wasn't it?)
There's things like // changing meaning (example code from the
Standard[1]:
{
int a = 4;
int b = 8 //* divide by a*/ a;
+a;
}
bingo, behaviour change.
The type of character literals has changed (from int to char); there are
new keywords which might clash with identifiers used in C++ (this one is
actually seen in practice sometimes); string literals are const...
... and many more. See the Standard.
>> It does sometimes seem to me that the architects of C++ (the guys on the
>> standards committees) seem to be on a mission to ensure job security
>> through obscurity. A lot of the ordinary mortals who use C++ stick to
>> the small subset of its features that they are familiar with and don't
>> venture beyond.
>
> Yes, agreed, which, IMHO, is why C++ is so hard to maintain - on top of its
> unnecessary complexity, every coder seems to use a different subset to
> another.
I find that most people use classes and Too Much Inheritance, and
sod-all else. They *should* be using templates, the STL, and sod-all
else in most cases, but they think `C++ == object-oriented' and focus on
`class' as the be-all and end-all :(
(this is calming down these days because most of the pure-OO fanatics
and language fashion followers have gone to Java. Thank goodness.)
> "TMTOWTDI" might be an advantage in perl, for example, but I
> reckon that trying to maintain some 10000-line C++ monster written by
> someone else in their style can be a nightmare.
I can't see why perl differs from C++ here. Indeed, perl has even *more*
barmy syntax than C++!
> Pete, certainly not a C++ guru, but I have used it a bit.
Nix, not a C++ or Perl guru, but I've had dinner with them.
[1] from the text of the Standard, you pedants; I know it's not
normative.
--
`You're the only person I know who can't tell the difference
between a pair of trousers and a desk.' --- Kieran, to me
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list