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

Re: C Tutorial ?



Jon Dowland <lists@alcopop.org> writes:

> At 1146961412 past the epoch, Roger Leigh wrote:
>> Note that programming GTK+ in C is not "C programming",
>> it's "GObject programming".  This requires that you know
>> not only about how objects are implemented on a
>> fundamental level by the C++ compiler (...), but how to
>> re-implement these concepts in C.  And, in addition,
>> several features from smalltalk such as properties.
>
> I disagree here. You do not need to know about most of the
> OO/C++ concepts you list in order to *use* GTK+, at least in
> a superficial sense. Some of them (properties) are needed
> for non-trivial programs, but low-level stuff like vtables
> etc. are hidden from you quite well.

I would argue that to build anything more complex than a trivial
"hello world" application, comprehensive knowledge of GObject/GType is
a requirement.  If you look at any GNOME application (gnumeric is a
good example), it is a set of objects all derived from GObject or
GtkWidget and their derived types, and the working application is a
collection of these objects linked together with e.g. signals and
containment.

That said, it's hard and error prone, which is why I abandoned C GTK+
development last year in favour of python.  It's IMO the main cause of
bugs, because the compiler just can't catch many mistakes.  If you do
use the C API, you end up expending a great deal of energy for
relatively little gain compared with using one of the other language
bindings.


Regards,
Roger

-- 
Roger Leigh
                Printing on GNU/Linux?  http://gutenprint.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.

Attachment: pgpcdzvAKIygs.pgp
Description: PGP signature


Reply to: