Linked by Thom Holwerda on Sat 26th Nov 2005 17:02 UTC, submitted by Megatux
Gnome "I followed the debate about a successor for the C/C++ combination as the primary language for developing the GNOME core desktop platform very closely last month. There has been discussion about a number of options. What I would like to do on this page is give an overview how a probably less well-known language might be a viable compromise as a C/C++ successor. This language is called Eiffel and exists for over a decade. Eiffel takes the principle of Object-Oriented programming to its extremes and, as a consequence, is a very easy to learn language."
Thread beginning with comment 65689
To read all comments associated with this story, please click here.
re. A couple of clarifications...
by JohnMG on Mon 28th Nov 2005 06:39 UTC
Member since:

> Java is *much* slower than C and C++.


Ok, here's the scenario: you've got GCC (including GCJ) installed on your GNU/Linux box. You write two neat GUI (GTK+) programs; one in C (or C++) and the other in Java. (The Java one is using the JavaGnome binding to Gnome/GTK+.)

Since you're using GCJ, you're compiling your Java code down to machine code -- just like with your C++ code. So, you end up with two binaries.

To run (for the first time), they both need to dynamically load their "standard libs" (in Java's case, I think this is or something). Perhaps the Java one takes a moment longer to load than the C/C++ one. Dunno. Maybe libjava soaks up more memory than libstdc++ -- again, dunno.

At this point, both programs run pretty fast. Perhaps you're able to detect that the C/C++ program is just a tad faster. Remember -- they're both machine code. They've both loaded their std libs into memory.

Now the question to ask is, since the end result of both programs is pretty much comparable, how do you decide whether to write your Gnome programs in Java or C/C++?

- which was quicker to write? (probably the Java one)
- which had fewer bugs? (probably the Java one)
- which is more likely to get other folks contributing to and improving it? (probably the Java one)
- which is more portable? (arguably, the Java one)
- which was easier to build? (I'm thinking of ant here)...

Now, looking at the big picture, how much does it really matter if the C (or C++) version runs marginally faster?

BTW, I'm not a particularly big fan of Java. If it were me, I'd probably just knock it out in even *less* time using Perl and the Perl-GTK+ binding. ;) But the point is, it's tough writing apps using C or C++, and even tougher to get other people to do it in their spare time. There's no "obviously better" solutions than using C or C++ for Gnome apps (and other infrastructure) -- but there are *marginally* better ones, IMO.

Reply Score: 1