Why program for Kde ?




I have had great fun programming with Kde and Qt. This page is meant as an invitation to join the developers, providing some good and objective reasons to do it (and a few more controversial reasons). If you are thinking about writing a Gui application or already started to do so, it is perhaps worth reading.

Content



Some bad reason not to program for Kde

These are wrong statements has heard too often about Kde. Although choosing not to join the Kde project is a perfect choice, don't base your decisions on wrong facts.

Kde is not free (original Qt issue)

This is past history now. We shouldn't hear that anymore. But you can still read it if you want to remember. Let's examine the history in detail to understand it right :
  1. In 1996, Mathias Ettrich calls for developers in a usenet post for a new project : KDE. The goal is to provide a user-friendly desktop. Kde will be developed with Qt, because the author thought it was the best available toolkit. At this time, the Qt license was : free for non commercial use.

  2. One year later, some free software developers were complaining about Qt not being free (while being freely available to developers) and not compatible with the GPL. The Kde folks didn't want to drop Qt and almost simply ignore the problem. They trusted TrollTech to solve it one day. In reaction, the Gnome project was started to provide a free replacement of Kde and the Harmony project was started to provide a free replacement of Qt.

  3. One or two years later, TrollTech announced they would release Qt 2.0 under a new license, that was to be discussed publically so that it would be compatible with the GPL and with Free Software in general. RMS, some Debian folks, some Kde folks, some Qt folks and others have debated a few month to produce the QPL v1.0, a recognised open source and free for developers license .

In january 1999, I asked RMS at the French Linux Expo if he thought Kde, with the new QPL, could be considered as free. His answer was Yes, it is free !. Although I don't see why you need Kde, you have Gnome. :-)

So this controversy should be closed.

Kde is violating the GPL (the debian issue)

This has also been hopefully resolved now! But let's examine again the details of this history:

The problem is that according to Debian, there is a copyright violation of the GPL when distributing binaries of Kde, because the license of Kde doesn't expicitely states it allows linking with Qt. The thing is that Kde is GPL but Qt is not. The GPL states that the whole executable must be GPL. If this is not the case, the author should give permission to link with non-GPL code. This freshmeat editorial discusses a few points where GPL and QPL (the Qt license) might not fit.

In this case, it is obvious that Kde people did agree to link their program with Qt, because their program won't run without Qt. RMS has agreed that in such a case (a program purposely developed to link with a given library, no replacement being available), this permission is implicitely granted. He also thinks that it is unwise to rely on implicit permission and that one should better make this explicit.

The debian folks don't want to distribute something with tiny license problem. They have in the past rejected applications for such reasons, even if it is obvious that the author intend to make its software free. Their point on the Kde matter is that if the permission is already granted, it is not really a copyright change to make it explicit (write it down).

The problem also arise stronger with application whose code is used in Kde but whose author never implicitely gave a permission to link with Qt. A typical example is kghostview which uses ghostview's code.

The Kde's point of view on this matter is that there is no need to give an explicit or implicit permission. They have asked their lawyers and they don't see any copyright violation with this. The GPL is not crystal clear on this matter and different lawyers have different point. So it could only be resolved in court.

About the fact that Kde should change its license and give explicit permission to link with Qt, the problem is different. There are thousand of people who have coded for kde. They gave their code to the project, agreeing on the license being used at this time. You can not change the license of Kde without asking all of them, because it is their code. Even if you know that they would agree to such a change, that they think linking with Qt was already permitted, changing a copyright is not allowed without the author's permission . It would be a very hard job to find all these people. Some of them are unknown (all code is not marked), some of them have disappeared from the net, uso. Kde is not willing to make such an effort, for an issue on which they don't agree.

This problem has generated a _lot_ of discussion. Kde claimed Debian and RMS were unfairly bashing Kde because they prefer Gnome. Debian claimed that Kde was in GPL violation. Kde got very bad publicity and a _lot_ of people half-knowledged about the problem have written stupidties about this.

Hopefully, there is an happy end. Qt was sick of being bashed over and over for the same problem. Because they think they can now control a free version of Qt, they have released Qt 2.2 under both GPL and QPL. This controversy is also closed, thanks again to TrollTech. Kde is now distributed by debian!

As a note, RMS has had a strange reaction to Qt being GPL. We won't know if there was really a GPL violation and it doesn't matter anymore. But, in any case, he has called to forgive kde for their actions. It sounds more like a religious call than anything. Why sould kde be forgiven ? For using code despite an unresolved issue ? For having violated the GPL ? In either case, noone have ever asked for foregiveness. Kde core developers have reacted strongly to this call.


If you want a more complete and detailed hisotry and analysis of the Kde Licensing problems, check the Chapter 19 of the Kde 2.0 Development Book, published under the Open Content License.

Kde uses C++ and C++ sucks !

This statement can be declined into two opposite flavors :

You can achieve C++ in C with pointers and a clean API
[ understand : everything should be written in good old plain C ]

I agree. You you can indeed replace a C++ program by a program cleanly written in C. But let's see why one wouldn't want to do that, at least for a Graphical application.

First, you have to agree that a Graphical application is in essence Object Orientied. You have bunches of widgets that you manipulate, aggregate, make interact with each other : you connect a button to a dialog, to actions. The GUI itself reacts to events that have to be propagated from one widget to another. Gtk, just like Qt, achieve this with an Object Oriented API and a signal/slot mechanism.

Then, why prefer C++ over C ? Well, C++ has been designed to support Objects, it is simply more suited to the task of writing an Object Oriented application. Consider a these points : So you can still do everything in C. But it will be a lot more complicated to design and to debug. This is an hazardous choice.

C++ is not a good language
[ understand: we should really get rid of C and C++ ]

This has been argued a thousand of times and there are some good points. Other languages such as Ada, Objective C, Eiffel, SmallTalk, Python, etc probably have better Object Oriented design, or better syntax, or better type checking, or better memory managment, less bloated feature, ... However, C++ has also some good points.
Anyway, the idea here is that C is still the standard, the default language, used in strong majority in the free software community . A lot of people know C. By writing your application in C, you are sure that 99% of the developers can understand your code and participate to your project.

Then, when you know C and want to learn about this Object Oriented stuff you have heard about, C++ comes as a reasonable choice. You already know the syntax, so you just have to figure out the Object part. Of course this is not as easy as it sounds, because if C++ has a C-like syntax, the object concept brings something completely new. But it doesn't matter. Because of this C/C++ compatibility, C++ is a widely known and learned language.

Now, if you want to take advantage of a more powerful but less mainstream language like Ada, SmallTalk or Objective C, you put at risks the greatest strength of free software : Peer review. Only the few people that can understand your programming language will be able to help you.
Choosing another language that the toolkit native one has also some serious drawbacks, as states Guillaume Laurent (maintainer of a C++ binding for Gtk) :

Kde doesn't use Corba, Kde doesn't use compononents

KDE doesn't use Corba and doesn't miss it. KDE uses KParts which has a lot of advantages over Corba. See my article about KPart for more info. I hope to finish one day my article about why KDE is not missing Corba at all.





Good reason no to program with Gnome/Gtk

I admit I like Kde very much. But I would probably consider Gnome with more consideration if there wasn't all the stuff I explain below. Note that some fellow gnomers agree with me on these points. Some, like Guillaume Laurent, maintainer of the Gtk-- binding have even changed their camp.

The gnome fondation

Well, I explain my point and the point of many kde developers here.

Miguel De Icaza

You might be surprised, but not everyone likes this guy. And this includes people using Gnome. He speaks a lot, and probably too much: Unix sucks ? ? Then why write a desktop for Unix then ? Gnome Staroffice Bonobo components ? Everyone speaks about them, but you will have to wait for a long time. Kde doen't have a clown like Miguel and KDE is not a circus. The project cleanly organised and lead by a _team_ of core-developers (not by a board of fundation members). I however admit Miguel helps a lot from a marketing point of view, while Kde lacks this kind of entertainement, that the press loves.

I want to use a GPL toolkit!

So you better leave Gtk, because GTK is LGPL. Despite what the FSF advises, the FSF and RMS are supporting Gtk/Gnome, which allow non-free software to be written with it. Qt is GPL, Kde is mostly LGPL, but they are ignored or unfairly bashed by RMS and the FSF. Ever wonder why Kde doesn't like RMS ?

Kde is more mature than Gnome. Gnome is two years behind Kde.

Well, I explain also my point and the point of many kde developers here. You can also sum it up to this: Kde 2 has had two major stable releases. Qt 2 has had three major releases (all binary compatible of course). Gnome and Gtk still havn't had their 2.0 release.

Your program will be bigger with Gnome/Gtk than with Kde/Qt

I have done a little analysis on this. The conclusion is that your program will be bigger and probably harder to read, not to say (but this is personal) harder to write. I hope to extend this analysis with other material (stay tuned).






Good reason no to program for Kde

You thought I wouldn't give any ? But in fact, there are good reasons no to program for kde. But not many.

I don't program at all

This is a very good reason :-). Note that in this case, this also a good reason no to program for Gnome :-). But, don't you want to have a try ? Programming is very fun and not that hard, especially if you try a nice language. I highly recommend Python and of course PyQt. You can achieve quickly and efficiently very good programs with it, like Klotski.

I really want to program in C/Ada/SmallTalk/Java

I used to say here that there are only one binding for KDE and Qt, the python binding. But this is not true anymore. Qt has bindings for Python, Ruby, Perl, Java, C, Objective C ( see developer.kde.org). The C bindings are generated from the C++ headers, so they are quite easy to maintain. And the C binding is used by the Objective C binding and by the Java binding. This binding allow almost any language to bind Qt.

On the KDE front, PyKde for KDE 2 is coming. The C, Java and Objective C binding are also available for KDE. So things are going quite well.

QtDesigner, the UI builder of Qt/KDE can generate code for C++ and for Python. It should not be hard to make it generate code for other bindings.

Note that even if you choose to program in one of these language, you can still interact and integrate within the Kde desktop. As a matter of fact, DCOP, the Kde Desktop COmmunication Protocol has bindings in C, Java, Perl and Python. And it is easy to add one more if you need it, or to use XML-RPC . With XPart, the DCOP based component Kde technology, you can even embed Kde components or have your application embedded as a component into a Kde application (they have embedded Mozilla with this).

I don't like TrollTech because they are making money

I have heard this once. I find this really stupid and I really hope this is an exception and very few people don't like TrollTech for this. TrollTech is providing the best Graphical Toolkit that has ever been available to the Free Software, under the GPL, and they shouldn't make money with it ? This would be non-sense. TrollTech uses the business model "free for free software, pay for non-free software" which I find very good.

I don't like the attitude of Kde

Kde core-developers have reacted strongly during the Kde licensing issue. But, hey, consider this: So, please understand that the Kde folks have had a lot of reasons to be angry. Most of these issues have been resolved though. Anyway, if you follow the project from a developer and technical point of view, people are very friendly, just like in most of every free software project. We are not here to have flamewar, we are here to code and have fun.






Good reason to program for Kde

I have already mention some of the reasons that make me prefer Kde/Qt to Gnome/Gtk. Check: But there is more than that:

I want to program in C++

C++ is the language of choice of Qt and Kde. On the Gtk side, you find more than 5 toolkits, none of them being correct. And particulary, Guillaume Laurent who wanted to program in C++ absolutely has been developing Gtk-- (a C++ binding as you guessed from the name :-) ) for 3 years, then switched to Qt/Kde. Now he is a regular Qt advocate and is the first to recognise that you are more efficient with Qt than with Gtk.

Why prefer C++ to C ? For a complex asynchronous program, like a Gui application, I find that C++, combined with Qt, provides cleaner code. Your code is easier to read because you know where it begins (constructor), where it ends (destructor), what is the available API (public members) and what are implementation details (private and protected members). So, by just having a look at the specification of a class, you know what its purpose is. Then the C++ provides nice features, like inheritance, operator overloading, function overloading, polymorphism, namespaces that make you coding life a lot easier than in C where you only have functions, struct and macros. My toolkit comparison highlights this.

I want to program in Python

Python has excellent bindings for Qt and Kde 1 (not for Kde 2 yet, unfortunately). Python integrates with Qt as if it was its native language and you can use all the excellent and copious documentation of Qt. The support of PyGtk and PyGnome is not that bad, but still inferior to PyQt. And with PyQt, you can release your program for Windows without any code change, because Qt and python support Windows natively.

Qt is more efficient than Gtk

The toolkit is very well written, full featured, with a very clean and good architecture, plus excellent documentation, tutorials and examples. Please check doc.trolltech.com to see by yourself. Read also, if you haven't done it yet my Analysis on this. Qt is simply two years ahead of Gtk, as I have previously said.

Great stable technologies

Kde uses great and fun technologies, which are very good documented and easy to use. Check deverloper.kde.org, especially the tutorials, documentation and architecture links. In Gnome, it is a pain to develop a Bonobo component or the equivalent of a kio_slave, as was explained at the OSDEM by Mathieu Lacage.






Conclusions

Okay, you can safely deduce from this that I love Kde and hate Gnome. This is not true. I love Kde and Qt, but I don't hate Gnome. There are just many things I dislike with the project and the way it is conducted. But I like, for example, the Gnome themes. I find them cooler than Kde themes, which are usually a bit too square. And Kde themes managment is really a pain at the moment.

I hope I have at least enlightened you on some Gnome vs Kde issues and you will have a more detailed look at the material I provided. Perhaps you are even now convinced to join Kde (my greatest hope). In this case, welcome. If you still prefer developing for Gnome, I wish you good luck because you will need it :-).





References


Last modification : $Date: 2002/03/02 22:21:21 $ - $Author: philippe $