Re: C vs C++ for GTK



Jon Harrop wrote:
On Saturday 24 November 2007 22:11, Patrick wrote:
I thought that C++ must be the way to go as it can do everything that C
can "plus plus" but some heavy hitters don't seem enthused with it,
Linus Torvalds in particular has been quoted as calling it a "horrible
language".

IIRC, Linus said that specifically in the context of systems programming.

My recommendation is to choose a garbage collected language for GUI work as it 
makes everything so much easier. Lots of GCd languages have GTK bindings 
these days.

Just because a language or library implements garbage collection doesn't
mean you don't need to manage resources.  Especially when you're working
with a GUI.  It's totally possible to leak memory in Python, C# or any
other managed language if you don't know what you are doing.  It's a bit
harder, but still a problem.  Recently the Darpa autonomous vehicle
challenge was lost by one group because their C# control system was
leaking very badly, requiring a restart every 30 minutes or so.

GTKmm is based on some very nice C++ abstractions around pointers,
providing many of the same benefits as any managed language with pure
C++.  They are called smart pointers and for GUI development, they work
very very well.  I find GTK in C++ to be almost as productive as python
or C#


Incidentally, has anyone tried GTK# from C# on Mono?

Yup.  It works awesomely well.  It's very clean.  Of course I can't
think of many reasons to do it anymore.  I use python most of the time now.




-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771




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