Re: Question about Glade vs no Glade




On Friday, June 11, 2004, at 12:28 AM, Glen Gibson wrote:

What is more resource intensive? A gtk2-perl script that uses Glade to build the GUI or just coding the GUI in the gtk2-perl script?

that depends on what resources you're talking about.

for machine resources, it's debatable whether the extra library and parsing involved in libglade is more work than the perl parsing and marshaling to do the same work in hand-coded perl. in the end, both hand-coded guis and libglade-created guis run at the same speed (faster than a human), so that's not an issue.

however, the simple fact is that in 90% of cases, using libglade will save you a ton of work, and programmer time is more important than machine time[1].

if you have a complex dynamic UI that is difficult to draw in glade (e.g. widgets exist or not depending on some other criteria) or you are creating a widget or you can't afford the extra dependency, then you need to hand-code things[2]. in all other cases, simple-to-medium applications, glade can save you a lot of time and work.

it can never hurt you to know how to create by hand what glade does for you. in fact, not knowing what glade is doing can turn Gtk2::GladeXML into a magic box, which in turn makes your debugging more painful when something goes awry.





Trying to decide if it's about time I learnt to build gtk2-perl apps using Glade for building the UI, leaving more time to write the stuff that does important things in the background.

i think you answered your own question.



[1] the exception is when an extra hour of programmer time can result in an optimization that saves a lot of time and/or money over a large amount of time. this is rarely the case in user-interface programming, more true for algorithms and data processing.

[2] those, and the fact that i deal with lots of custom widgets for which i have never written glade interface modules, are pretty much the reasons i don't use glade myself... though i've flirted with it many times.

--
Walk softly, and carry a BFG-9000.
  -- unknown




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