[9279] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Was : Why is gtk+ written in C? - now : Quick Rant

daemon@ATHENA.MIT.EDU (julian.gosnell@nomura.co.uk)
Wed Oct 14 06:22:43 1998

From: julian.gosnell@nomura.co.uk
Date: Wed, 14 Oct 98 11:21:04 +0100
In-Reply-To: <Pine.LNX.3.96LJ1.1b7.981014093225.2090U-100000@ume.pht.co.jp>
To: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

> On Tue, 13 Oct 1998, Eric Harlow wrote:
> 

When I started reading this thread I said to myself, now Jules, don't get into a
 religious argument - however, I am very weak willed...

We have just left the 'why was gtk written in C and not C++' arena and strolled
 into the 'let's make unsubstantiated attacks on C++' arena.

> (1) C++ is a lumbering oafish mess
personal opinion and doesn't really bring much to the discussion...

> (2) that eats resources
you pay as you go - try compiling your ANSI C code with an ANSI C++ compiler and
 comparing the resultant programs.

> (3) and pisses people off.
see (1)

> (4) If you write it in C it's faster,
see (2)

> (5) more compact
see (2)

> (6) uses less memory
see (2)

> (7) and you can incorporate it in, among other things, C++ programs.

true.

> (8) Incorporating
> C++ into C programs, however, is like trying to nail jello to a tree, in
> most cases. 

Try using static functions to wrap dynamic ones.

> (9) Qt is written in C++, and IMHO, is one of the reasons (among
> several) that Qt sucks and gtk+ does not.

I have never used Qt so cannot comment

> (10) Writing in C assures that other
> people can develop a competent C++ binding, a perl binding, a Python
> binding, etc..

True - although more and more languages are having C++ bindings provided for
 them.


In conclusion, ANSI C is a subset of C++. Stick to this subset and it will cost
 you no more than C itself. Take advantage of C++'s extra features where
 appropriate and you pay a corresponding price. If you think that you can
 provide similar features in a C program for less cost than C++ can, please
 submit them to the C++ community - I'm sure they would be delighted to consider
 your optimisations.

As for why GTK was written in C and not C++ - read the rest of this thread.
 There are many good reasons given there.

I apologise to everyone for being drawn out on this one - I just can't stand
 seeing popular misconceptions being promulgated as fact.


Jules

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post