[Shootout-list] Re: OO (was Re: process creation & message passing)
Brent Fulgham
bfulg@pacbell.net
Thu, 21 Oct 2004 11:05:39 -0700 (PDT)
--- Brandon J. Van Every wrote:
> > > It is not fine. There is no such widespread OO
> > > system for C. The overwhelming majority of
> > > people do not use C this way.
--- I wrote:
> > The GTK toolkit uses exactly this model. They
> > wrote their own object hierarchy in C.
--- Brandon again:
> I'll repeat: the overwhelming majority of people do
> not use C this way. Compared to all C users, GTK is
> a little teeny tiny blip on the radar.
Another domain would be embedded systems, where C++
or Java is not often an option. There have been
many projects done in this domain using C, with an
OO hierarchy implemented to help with code reuse.
> There's a difference between an OO widget API and an
> OO *language*. OO widget APIs only facilitate the
> writing of additional widgets. I'm using the
> word 'facilitate' quite generously here.
No -- you are making the common mistake of assuming
there is any fundamental difference between languages
and libraries. They are equivalent. A library can
graft a new language onto an existing "language".
I disagree that a C entry with an object system is of
no interest, and I have shown at least two real-world
cases where people have had to solve this problem. I
think the shootout benefits from having a metric that
indicates how well this approach works (in terms of
the trade-off of performance versus LOC).
> Well, your view is quite a minority view. Almost
> nobody else out there is having a debate about
> whether C is an OO language or not.
And I'm not either. I agree that C is not an OO
language; I'm just saying that OO techniques can be
used in it; and that even a whole OO "language" can
be provided as a library. Does this compete with
C++ or Objective C? Yes -- this is exactly how those
languages were originally implemented. And in certain
domains, OO add-ons to C are still used.
I'd like the shootout to be able to help someone show
his boss "Hey, C++ is way better than our crufty C OO
library because it's half the LOC to maintain, or it's
only 0.5% slower on these types of problems, so let's
use it".
> What do you see as the goal for the shootout?
> Trying anything and everything, no matter how brain
> dead?
Of course not.
> I'm getting tired of all the various goals,
> honestly. I don't really believe that anyone's
going
> to put any energy at all into *my* goals.
Why would you expect anyone to put energy into
your goals, when you haven't put any energy there
yourself? Lead by example, man!
> It's time for me to bow out of this project /
> discussion.
Well, I'm sorry you feel that way. While I don't
agree with all of your goals, the discussion has
been beneficial (at least to me) in crystallizing
various aspects of the shootout.
-Brent