[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (OT) Re: memory management

Bert Peers wrote:
> Actually I should have said : "... and need some SDKs but no OOP".  Because that
> is what the general sentiment actually is, the kernel and other "real world" stuff
> is still
> written in C so that's interpreted like "for the real work, C++ is still too
> slow/immature/obfuscated/beta/whatever".  At least that's the impression I get from
> watching some Linux developers.  OO is academic and C++ is slow.

You misunderstand why Kernel's and major libraries like OpenGL are not
in C++...well, actually they might be written in C++ - but the API's are
in C++.

The reason for this is simple.  A major service API must be written so
can be accessed from C, C++, Fortran, Cobol, you name it.  There is no
that C programs could run portably if (for example) the UNIX interface
layers were object-oriented with C interfaces.

It's nothing to do with the quality, usability, performance or anything
else of C++ ...it's simply that you have to play to the lowest common
denominator.  Heck, most OS API's can be driven with structures of any
kind!  There are a couple of exceptions in the UNIX standard library -
not many.

> > My hart goes to Scheme. Objective-C is such a useful and
> > clean/small addition to C that I just can't belive nobody uses it. OTOH C++ is
> > such a messy bloat that I can't belive anybody would wan't to use it!
> This I guess is a matter of taste.  But again that's not what I meant to argue,
> maybe you're right in that Objective-C can offer more robustness and cleaner
> interfaces if a C++ SDK would be redesigned in O-C - but the problem is that
> the Linux community doesn't want OO at all, be it clean or bloated.

I think the relative acceptance of C++ over OC is more a matter or speed
of ease of coding, etc.
> > All will argue that C++ offers you many useful things, like function and
> > operator overloading, multiple inheritance and templates, but 90% of those will
> > later agree that operator overloading is a bad thing and should not be used,
> > multiple inheritance creates more problems than it's worth and templates should
> > be avoided at all costs. What is left then?

I agree - I've been a C++ programmer since the very first cut of the
(the AT&T translator) when if you found a bug, you had to phone Bjarne
to get it
worked on.  I've tried every feature of the language at one time or
and I've definitely come to the same conclusion:  'operator'
multiple inheritance and templates are definitely mis-features...and you
see them used in any of my code.  I'd add 'friend', exceptin handling
stream I/O to that list too.

However, it's easy to avoid features that are bad - just as good C
avoid 'goto'.

Just like so many things in software, C++ was essentially complete in
it's very
first release - almost everything that's been added since then is just

> Is that the 90% of the community that's not getting enough time off from their day
> jobs to keep educated on the latest software tech ? :^)  I don't know why templates
> are evil, and imho overloading is cool too, but talks about may be better taken
> offline

Overloading is OK - (great in fact) - but OPERATOR overloading is evil
it can result in people writing code that leads you to believe you
it when in fact you don't.

Templates generate code 'behind your back' - and technology of current
an debuggers doesn't make them very stable in practical implementations.

Steve Baker                  http://web2.airmail.net/sjbaker1
sjbaker1@airmail.net (home)  http://www.woodsoup.org/~sbaker
sjbaker@hti.com      (work)