gnu-misc-discuss
[Top][All Lists]
Advanced

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

Re: C++ equivalent to spaghetti code


From: David Kastrup
Subject: Re: C++ equivalent to spaghetti code
Date: Mon, 21 Jul 2008 08:43:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Wolfgang Draxinger <wdraxinger@darkstargames.de> writes:

> Sherman Pendley wrote:
>
>> "Lorenzo Villari" <vlllnz@alice.it> writes:
>> 
>>> I'm maybe wrong, but I was under the impression that for
>>> Firefox they use gtk+, which is written in C...
>> 
>> Gtk+ is indeed written in C, but it's object-oriented
>
> And?!
>
> Coding something in C doesn't mean you must abandon using OOP
> methods. It just means, that things are going to be a bit more
> verbose (i.e. you've to maintain everything yourself).

Well, message passing, the fundamental defining characteristic of OOP (I
mean, this is what made Smalltalk revolutionary with regard to
programming techniques and gave it its name) requires you to switch
sustained execution contexts, basically switching to a different stack,
eveery object having its own control flow.  Synchronous multithreading
or whatever you want to call it.  That's what OO is actually about.  The
in-memory and synchronous in-process equivalent to separate applications
with separate control flow talking to one another via pipes.

Of course, C++ does not have it either.  When it laid claim to the
buzzphrase OO, its reference implementation Cfront could not map this
aspect to C, and so one implemented and declared a humongous wagonload
of other features to befuddle detractors and turn them away in disgust
before they noticed the missing essential detail.

The Cfront language design inheritage indeed means that for the most
part, you can't do anything in C++ that is not fundamentally accessible
in C.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

[Prev in Thread] Current Thread [Next in Thread]