Skip to main content

Ralsina.Me — Roberto Alsina's website

Well ordered toolkits

I think some months of for­mal math train­ing would do won­ders for the av­er­age guy.

And I don't mean al­ge­bra, I mean log­ic, set the­o­ry, that kind of thing.

The ob­vi­ous ex­am­ple is, of course, com­par­ing two things. There is the con­cept of the well or­dered set. In a well or­dered set, for any sub­set, there is a larg­er and a small­er mem­ber.

In oth­er word­s, if you com­pare any group of things, one is the largest, one is the small­est.

That may seem ob­vi­ous, be­cause peo­ple on­ly think in terms of in­te­ger or re­al num­bers when they see > , but re­al life is dif­fer­en­t. Re­al life ob­jects are usu­al­ly not well or­dered, and that means you can't sort the whole set, noth­ing ev­er comes out on top.

Be­cause the crap­py math peo­ple learn makes them think in lin­ear terms [1], re­al­i­ty is ap­proached in lin­ear, lim­it­ed terms.

what I am think­ing about:

Peo­ple say Qt is bet­ter than GTK+ or vicev­er­sa.

Well, those are mul­ti­di­men­sion­al ob­jects you are com­par­ing, and in or­der to make it mean­ing­ful, you need to es­tab­lish a met­ric that will make the toolk­it-s­pace a well or­dered set.

That met­ric, sad­ly, is sub­jec­tive and per­son­al. While Bruce Peren­s[1] may see the ac­qui­si­tion cost for pro­pri­etary de­vel­op­ers as the most sig­nif­i­cant part of it[2], oth­ers may see techi­cal fea­tures as more im­por­tan­t.

But the telling point is this:

If you are a free soft­ware de­vel­op­er, why would you choose GTK+? What is your met­ric, where GTK+ is larg­er?

I re­al­ly have no clue on that, since I haven't touched GTK+ since I re­coiled in hor­ror from it in ear­ly 1996, but I will try my best.

  • You pre­fer cod­ing in C

  • You want your app to work well with GNOME

  • You find the GTK+ API ap­­peal­ing

  • You like some GTK+ de­vel­op­­ment tool, like glade

  • You see bet­ter per­­for­­mance in GTK+ than in oth­­er tool­k­its

I can't find any oth­er rea­son­s, and even one or two of those seem iffy to me ;-)

You pre­fer cod­ing in C: Ok, that's rea­son­able. If you want to code in C, GTK+ is prob­a­bly the way to go.

But why, oh, why do you want to do that? Re­al­ly, come on, C is a poor lan­guage for al­most ev­ery use. Your lan­guage met­ric is prob­a­bly the guilty part of your choice of GTK+. But that's an­oth­er set.

You want your app to work well with GNOME: Ok, that is rea­son­able. I could say Qt apps work well with GNOME, too, but that's my own sub­jec­tive bi­as, and re­al­ly not de­fen­si­ble, since GTK+ apps do work bet­ter with GNOME.

The GTK+ API is ap­peal­ing to you: you are a sick per­son? ;-) Ok, that was harsh: you have bad taste in APIs? Ok, that was still harsh: I don't un­der­stand you. Yeah, that's bet­ter.

Luck­i­ly, you don't have to use it, you can use de­cent wrap­per­s, nowa­days.

You like a de­vel­op­ment tool, like glade: I don't see glade as a big thing com­pared to oth­er­s, but hey, that's just my taste. Rea­son­able point.

Per­for­mance: You want per­for­mance? Use fltk. Even pure Qt seems to be about on par with GTK+. Of course if you pair this with the C ar­gu­men­t, they sin­er­gize. Af­ter al­l, GTK+ does have bet­ter per­for­mance than Xaw3D or some­such. Maybe XForm­s?

Please, if any­one reads this, I am not try­ing to flame GTK+ or its de­vel­op­er­s. I am sure GTK+ is the great­est C tool­kit around, and de­vel­oped by smart peo­ple.

I just al­so don't see any com­pel­ing rea­son to use the thing for free soft­ware de­vel­op­men­t. For pro­pri­etary cod­ing? May­be, if you are low in cash. My own met­ric (for what­ev­er lit­tle it's worth) does­n't make me see GTK+ as an in­ter­est­ing tool. If yours does, please help me im­prove it.

Yes, I know stuff like say­ing the API is ug­ly can't be im­proved, be­cause you can't con­vince me that it is­n't[4], but you can help pro­vide new rea­son­s, or strength­en oth­er­s, or maybe tell me bad points about the tool­kit I see as bet­ter.


[1] Ok, peo­ple think that way even if they don't learn math, the thing is, math teach­es you to think non-­lin­ear, or mul­ti­di­men­sion­al.

[2] An in­ter­est­ing fel­low. Re­mem­ber when he quit De­bian in a huf­f?, and that he was go­ing to de­vel­op a Red Hat-based dis­tro that was more desk­top-ori­ent­ed? That was prob­a­bly around 1998 or 1999, IIR­C. BTW: you won't find all of it in the De­bian archives, "some­one" re­moved it.

[3] Which is re­al­ly a bizarre ar­gu­men­t, is­n't it?

[4] I al­so think most of Dalí's and Pi­cas­so's paint­ings are ug­ly. How can any­one con­vince me they aren't? They can't.


Contents © 2000-2024 Roberto Alsina