----- Forwarded Message ----
From: JAMES SCOTT <[EMAIL PROTECTED]>
To: Michael L Torrie <[EMAIL PROTECTED]>
Sent: Monday, November 26, 2007 2:37:18 PM
Subject: Re: C vs C++ for GTK

To list members following this subject: I have a question - not a flame, as I 
try to understand the diversity of responses to this topic.

How many of you who have suggested "Patrick" learn something other than C, know 
C already for yourself.  Over the course of my experience I have found that 
learning assembler and C for a given platform has helped me better understand 
and use that platform.  Also, knowing C make picking up or reading other 
languages like - python, php, perl, and many others easier.

I'm assuming that, those of you who are pointing another way - already know C!  
Why not let Patrick follow your well worn path through C/GLIB/GTK2, maybe he 
will come out afterwards to C++,
 Python, or some other door.

Yes, my preference is C/GLib/Gtk+.  But I use lots of other when needed.

James,
"Just another Hobbyist and Professional Developer: 35+ years"

----- Original Message ----
From: Michael L Torrie <[EMAIL PROTECTED]>
To: Patrick <[EMAIL PROTECTED]>
Cc: gtk-app-devel-list@gnome.org
Sent: Monday, November 26, 2007 1:11:07 PM
Subject: Re: C vs C++ for GTK

Patrick wrote:
> Hi Everyone.
> 
> Sorry for the flame war bait, I know how passionate language debates 
> get  but I need some guidance. I am using PyGTK right now and I am
 happy 
> with it, but a day is coming soon were the speed limitations and 
> less-then-straight-forward threading will be an issue.

I don't see any reason at all why a GUI done with PyGTK should be any
slower than a GUI done with straight C.  Thus I don't see any
 compelling
reason to abandon Python for C or C++.

That said, however, Python sometimes isn't the right language to use
 for
computationally-intensive tasks.

Personally I think you are going about this the wrong way.  You could
 be
wanting to do premature optimization.  Rather than trying to replace
python, you should consider either extending python with C or C++, to
replace the slowest and most-used computational paths, and stick with
python for everything else. It's very easy to write python modules in C
(10 hours to learn), or C++ (Boost makes it easy to wrap C++ classes
 and
functions).  Alternatively you can code in C or C++ and embed Python to
drive your GUI.

> 
> I figure my next move should be to learn C or C++. I would like to
 stay 
> up-to-date with things and I would like to be able to reuse GTK code 
> from other Apps.

When it comes to the basic API, translating a code-generated GUI
 between
python and C++ (with GTKmm) should be very simple.  Even translating it
to C won't be that hard either, except that you don't have an easy way
to bind callbacks to a particular instance of data without some work,
like setting data values and using the void *data argument on the
 callbacks.

> 
> 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".

>From my experience it is those that don't understand C++ and how to
wield it that describe it that way.  Torvalds is biased anyway, since
he's focused on kernel programming.

> 
> I can only spend 8-12 hours a week programming, I am not a
 professional 
> programmer, is C++ to complicated? Is C going out of date? Am I
 limited 
> with C?

C++ is complicated, but not overly so.  I feel that coming from Python,
C++ is probably going to be easier for you to move to than C.

Again, though, I think

> 
> Thanks-Patrick
> 
> 
> 
> 
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 


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

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list







_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to