Re: [dev] [OT] What's wrong with C++?

From: Kris Maglione <maglione.k_AT_gmail.com>
Date: Fri, 10 Sep 2010 17:10:13 -0400

On Fri, Sep 10, 2010 at 08:19:38PM +0300, Nikhilesh S wrote:
>I must start out saying I don't have much experience in software
>development with larger teams on large projects or with lots of other
>people, or in 'commercial software development' in companies - I've
>just done stuff as a hobby in my free time for the past 5 years or so,
>learning on my own - but I hope to learn more in the coming years (going
>to university next year).

Wow you write long emails for flame-bait...

There's a very good quote to answer your question in brief,

     C++: an octopus made by nailing extra legs onto a dog.

>In C, to the best of my knowledge, either you would do this by having an
>enum of types and 'switching' on it, or by doing a function pointer table
>thing (which is functionally (no pun intended) equivalent to a virtual
>function table right?). So aren't you just building the same idea on it
>again? I've also seen in a lot of open-source C code some kind of attempt
>at making OO-stuff in C such as the 'GObject' things. Often a lot of the
>code is of the form somestruct_dosomething(struct somestruct *p, ... ).

Please don't mention GObject. Nearly anything GNU is not worth
mentioning.

>I haven't really understood the problems with C++ that the people here
>that have problems with C++ have, although I must say in recent years
>(especially with C++0x?) they've been adding a lot of features and it's
>getting a little 'fat'. Are you just feeling the same thing, just that
>you probably used C before C++ or have otherwise been at it for a long
>time and thus this feeling has come in earlier?
>
>Maybe C++ is 'complex' but doing things with it is 'simple', whereas
>it's the other way round in C? Look at ASM and C for instance - I've only
>lightly touched ASM but I think it's simpler than C but doing things in
>C is simpler than in ASM.
>
>Is C++ broken because no one really understands it fully? Is allowing
>multiple paradigms in a single langauge a problem? Should language
>enforce paradigm?

It's not OO that we're against. Not per se, anyway. It's that
C++ is simply a poorly designed hodge-podge that basically nails
a lot of extra features on C, without any real core design
principles, and incidentally kept the heinous old textual
preprocessor and added yet another symbolic preprocessor just to
insult to insanity. For an example of what C++ should have been,
have a look at D, which is easily as simple as C and more
powerful than C++. And now there's Go, and there's always been
Lisp and Objective-C, both of which have cleaner designs than
C++ and follow the original Object Oriented model much better
than the latter.

-- 
Kris Maglione
You do not really understand something unless you can explain it to
your grandmother.
	--Albert Einstein
Received on Fri Sep 10 2010 - 23:10:13 CEST

This archive was generated by hypermail 2.2.0 : Fri Sep 10 2010 - 23:12:02 CEST