Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre kde (publicaciones antiguas, página 7)

The case against cooperation

I of­ten see and read about co­op­er­a­tion in free soft­ware. I read about how mul­ti­ple com­pet­ing projects are coun­ter­pro­duc­tive, about how co­op­er­a­tion would make things go faster...

You know, that's all wrong. I am not say­ing co­op­er­a­tion does­n't have its place, it does! It's just that not ev­ery­thing works bet­ter with co­op­er­a­tion.

I will just talk about what I know, and what I know is very lit­tle, so sor­ry if the ex­am­ples are too tight­ly fo­cused, but I am a small pic­ture guy.

Ex­am­ple I: KDE and GNOME

For the GNOME fan­s: If co­op­er­a­tion were more in vogue in 1996, your ob­ject of af­fec­tion would­n't ex­ist, so that's it for you.

For the KDE fan­s, the case is a lit­tle hard­er to make, be­cause we as­sume that we would be bet­ter along if GNOME had­n't ex­ist­ed (I had even said that a few times).

Al­though it is not pos­si­ble to prove one thing or the oth­er, since his­to­ry is not an ex­per­i­men­tal sci­ence, al­low me to point out that KDE's goals were much small­er, its scope im­mense­ly less am­bi­tious. It was meant to be about 20 small pro­gram­s, not a mul­ti­mil­lion-LOC thing.

GNOME was part of the in­cen­tive to move in­to the larg­er stage. Think of it as an arms race.

Let's face it, some things were de­vel­oped just be­cause GNOME had them, or even be­cause they did­n't have them yet ;-)

I as­sume GNOME guys can say sim­i­lar things, it should be even more ob­vi­ous in their case, since the project was start­ed be­cause of KDE (Miguel once said some­thing like KDE con­vinced him that it was pos­si­ble to do[1])

So, co­op­er­a­tion would have been detri­men­tal. It's not that co­op­er­a­tion hurts de­vel­op­men­t, but that com­pe­ti­tion fu­els am­bi­tion, and am­bi­tion fu­els de­vel­op­men­t.

Ex­am­ple 2: Mad sci­en­tist syn­drome

Once up­on a time, Raster­man had start­ed de­vel­op­ing what he called 'themes' for Gtk+.

You know, I had read some of his code when he start­ed hack­ing fvwm, and while I re­spect his graph­ic skills (although his taste is hor­rid to me [2]), his cod­ing skill­s... well, let's say that I don't hold mine in high es­teem, but his code... well, I sup­pose it was good in some ef­fi­cien­cy sense... I hope it was, else it was un­for­giv­able.

Al­so, I was con­vinced that Qt was way bet­ter than Gtk+ in any con­ceiv­able sense[3], so I thought... how is he do­ing it?

It turns out that he was re­plac­ing the draw­ing code for the wid­gets with what would lat­er be known as the "pixmap en­gine". The draw­ing code read a con­fig file, load­ed pixmaps and past­ed them over the place the wid­get would be.

Mind you: that scheme is hideous for many rea­son­s, and sim­ple bad­ly de­signed (y­ou can't change your colours in any rea­son­able way, for ex­am­ple). But... I had trou­bles.

You see, we are talk­ing Qt 1.x at the time. Un­der the non-free-­soft­ware li­cense. I could­n't touch Qt, so I could­n't mod­i­fy the draw­ing code.

So, how could I show Qt was bet­ter? By do­ing an evil hack (T­M)[4], of course. I in­ter­cept­ed the draw­ing events in the ap­pli­ca­tion class.

I held lists of wid­gets at cre­ation, I di­vert­ed the ex­pose events off the tool­kit code, I sub­classed the ap­pli­ca­tion class, I over­rode the com­piled code with LD_PRELOAD, I used al­most ev­ery evil hack­ery I could find, and you know what? It worked. I had a screen­shot to show, too.

In fac­t, in 36 hours I had a more ad­vanced them­ing en­gine than Raster­man's, by some mea­sures (I had themed way more wid­get­s).

I showed it to some KDE guys, Kalle showed it to some Troll­s, they got so nau­se­at­ed by it, I still think it part­ly con­vinced them to add styles in Qt 2.x, so I would­n't have them look at it again (It used, af­ter al­l, on­ly the pub­lic APIs).

So, where is the con­nec­tion be­tween that sto­ry and co­op­er­a­tion? Oh, grasshop­er, the con­nec­tion is that there was­n't any con­nec­tion.

Had I been a co­op­er­a­tive sort, I would have shown the ideas to some­one and been laughed at. Or I would have con­tact­ed some of the Trolls (I knew a few of them back then) and would have been con­vinced that it was a bad idea (it was :-)

The on­ly rea­son why I cod­ed for 36 straight hours was be­cause I re­al­ly re­al­ly re­al­ly was pissed off that Raster­man could hack Gtk+ and I could­n't do the same thing to Qt.

So, co­op­er­a­tion drives to the av­er­age. Co­op­er­a­tion begets bland. And while bland is good for you, if ev­ery­thing was bland, free soft­ware would suck im­mense­ly. Free soft­ware is not a tool for a goal, at least not for some of those writ­ing it, it is a toy, in the good sense, some­thing that is use­ful for it­self, in it­self, even if it does noth­ing. So are jew­el­s, you know.

While a project can not be de­vel­oped by a sin­gle per­son, a de­sign al­most cer­tain­ly MUST, spe­cial­ly if it's a new or strange one. And some stuff re­al­ly has to be done in soli­tude, or it won't be done.


[1] I re­al­ly don't like the guy (old sto­ry don't ask), but hey, why would he lie about that?

[2] My taste is hor­rid to me, too.

[3] I nev­er said my opin­ions were ver ra­tio­nal

[4] And I mean evil. Evil as in mor­dor-­code, evil as in a de­sign so hideous I still re­mem­ber it :-)

Listen to me!

Ok, noone will both­er, but you can lis­ten to me speak­ing about KDE in a Lin­ux event last year, in Ogg For­mat, in span­ish.

I just ran in­to this by googling for my name :-)

It is the first time I like the way my voice sounds in a record­ing, too.

Confused by QMimeSourceFactory

Ok, here it goes. If you are not flu­ent in Qt pro­gram­ming the fol­low­ing en­try will make no sense what­so­ev­er :-)

If you set the con­tents of a QTextBrowser, and the con­tent is HTM­L, it will call its QMime­Source­Fac­to­ry's data() method to get MimeOb­jects rep­re­sent­ing, for ex­am­ple, im­ages in the HTM­L.

So far so good.

How­ev­er, I am mist­i­fied by this: While it's do­ing that, you can change the con­tents, and it will go along it's mer­ry way, ex­cept that old data() calls are still in progress.

In oth­er word­s, it acts as if it's mul­ti­thread­ed. Usu­al­ly, in Qt, this is be­cause some­one is call­ing QAp­p::pro­ces­sEv­ents, and then you have mul­ti­ple func­tions run­ning and yield­ing to each oth­er in the Qt event loop.

That is sure­ly what's hap­pene­ing, but... how the hell does one stop the old data() call­s????

The pro­ces­sEv­ents call is not made by me, it's done in­ter­nal­ly by some method in the QTextBrows­er.... so, right now, in KRsN, some­times you are down­load­ing im­ages for old stuff you saw min­utes ago!

KRsN teaser number 4

Ok, so teas­er num­ber 3 was a long time ago ;-)

I just added web brows­ing ca­pa­bil­i­ties to it. Now, if you fol­low a link, it will open in KRsN's win­dow.

If you have KDE, it will soon open in an em­bed­ded kon­qy, but if you have Qt, it still dis­plays pages quite nice­ly, as shown here.

Ex­cept for the stylesheet, and some miss­ing im­ages, it looks al­most ok!

Contents © 2000-2024 Roberto Alsina