Re: What's about the efficiency of using c to OOP compare to the c++'s abstraction?



On 5/4/07, la deng <ladeng mimi gmail com> wrote:
Then ,what's the power of gobject vs c++ with the compiler's
Intelligence in OOP?

I think the usual answers are:

1) portability: you can get a standard C compiler anywhere; C++ (at
least back when gtk was started) is less portable

2) ease of language binding: it is significantly more difficult to
make a binding for a language like Perl from a C++ library than a C
library (though SWIG is pretty fantastic now)

3) ease of ABI maintenance: with C it's (usually) easy to see what
source code changes will break ABI compatibility; C++ makes this (in
my experience) much harder

4) history and personal developer preference: gtk has always been C,
most of the developers either like it that way or don't object enough
to bother complaining, it's hard to see it ever changing

5) unimportance: C++ might bring some small speed improvements, or it
might not (see Qt's linking problems, though they might have fixed
that), but in any case, 10% speed improvements in a widget toolkit
internals are almost invisible to the user

.. probably some more I've missed.



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