Re: object-oriented C programming
> PB> The most useful, innovative feature of all of the OOP
> PB> movement, is proper object encapsulation.
>
> "The most useful, innovative feature of a baseball stadium is the
> peanuts. Therefore, I'm declaring this peanut a baseball stadium."
Perhaps you could come up with a useful counterexample?
Don't worry I'll do it for you :)
I feel that inheritance, type-safety, const-safety etc
can be implemented just as in gtk+, which is undeniably
object-oriented and in c.
There are real issues: object-lifetime, reflection, templating,
for a few (not to mention a lot more "typing" (though cut-n-paste and
macros aren't really typing)) but gtk+ clearly shows how to approach
the problem, and frankly, looking at the api leaves us with the
sense that "new Object" and destructors don't really solve the problems
that "gtk_signal_connect" and "gtk_object_{ref,unref}" solve.
So i think (besides syntax) gtk+ provides a richer OO environment.
Very sorry to drag on this flame war,
dave
Reply to: