Re: Java Versus gtk



On Tue, 17 Feb 2004, Gus Koppel wrote:

Sorry if this Qt thing is a bit off-topic to GTK list, but I wish
to add some additional comments because the debate feels rather
interesting.

Yes they still are, but Qt-designer is the tool that functions
exactly like Delphi. Only thing is that the integrated text editor
is junk and therefore I use KDevelop for text editing instead
(yes, I avoid Emacs and hate Vi and its variants).

One could also add, that QT applications can be developped
using Microsoft Visual or Borland tools. I wasn't working with them + QT
but I suppose they are not well suited to produce portable applications.
I don't know to which extent they support QT either.

I think the only way to do Qt right is to use the Qt designer
if you ask from me. With using that it is extremely easy to make
GUI software. To do some simple GUI tools with Qt-designer, one
needs only several minutes to learn it all. Very fast learning curve.

On the other hand, there are quite some fully featured Java IDEs, some
of them for free, which certainly support full portability of Java.

I dislike all Java IDEs I have tried by the way.

To my knowledge, for GTK+ there is currently only Glade. While being a
good tool to design UIs, it's far from being an IDE.

Qt-designer is closer to IDE than Glade allthough it still isn't IDE.
But IDE enough for making things easy in my opinion. By doing the
text editing and perhaps compilation in KDevelop and switching between
Qt Designer and KDevelop, it is rather easy and efficient. Allthough
I must admit that I do not use KDevelop for compilation because
I have used to compile from command line.

By this I wasn't referring to the language itself but the GUIs instead.
While Java is relatively easy to learn, learning to program Swing in my
opinion isn't. Furthermore, I believe GTK+ is easier to learn than QT
because there is not quite that huge number of classes and C++-specific
extra behaviour to regard.

I think the number of classes helps instead of making things hard.
Swing is not hard IMHO and neither is Qt. 

been less than 5000 lines long with C++ and would have contained
a lot less pointers. I was unable to convince
those decided which language was chosen with my C++ claims.

Besides the fact that you can format C and C++ source in any way you
want so the number of lines is rather arbitrary,

I don't mean that. I mean that there are built-in classes for many
kind of things in C++ standard library. One example is STL.
For example we needed a linked list to the program. It was easy to 
implement with C and there are millions of examples how to do it,
but it was about 1000 lines of extra code where it would have been
in C++ just one line: std::list<std::string> stringlist;

I haven't seen such
dramatic examples.

One example: A simple dictionary where keyword (string) points
to a list of strings:
Try this with C (how many hundreds of lines of code you'll get since
in C you must implement a tree to accomplish the same efficiency
and in the std::map which used internally a red-black tree):

#include <string>
#include <vector>
#include <map>
...

std::map<std::string,std::vector<std::string> > stringmap;

std::vector<std::string> translation;
translation.push_back(std::string("tietokone"));
translation.push_back(std::string("tietojenkäsittelylaite"));
stringmap[std::string("computer")]=translation;
std::vector<std::string> diggedFromMap = 
stringmap[std::string("computer")];
std::cout << diggedFromMap[0] << std::endl;
std::cout << diggedFromMap[1] << std::endl;

(Sorry, I didn't verify if there are typos in my code, it is possible
that it won't work).

Also regard that most accesses to C++ objects are
done technically via pointers as well. Just the notation differs.

Of course there are pointers, but for example dynamic memory allocation
can be left to the problem of the standard library and the user
can write code that never leaks assuming that the standard library
contains no bugs. In STL it is implemented better than in Java.
The garbage collection rarely works right and Java programs tend to leak.
In STL however, memory is freed when a structure goes out of visibility
(past end of the block).

Best Regards,
Karoliina Salminen

/*  
 * | Karoliina Salminen | karoliinasalminen karoliinasalminen com |
 * | http://www.karoliinasalminen.com | http://www.ampcast.com/karoliina |
 *
 */




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