Re: How do you develop you GTK code?



On Tue, Apr 17, 2007 at 10:42:08AM -0400, Tristan Van Berkom wrote:
> 
> If your program is a long term investment and undergoes frequent
> refactoring, then do it now :) you will significantly improve your
> code's legibility, reduce lots of code and as such; add value
> to your product, this is not just my pointed opinion - libglade
> reduces complexity from your code

It redistributes complexity to other places and to relations
between the code and the other places, if that is what you
mean by `reducing complexity from your code', however it
does not reduce the total.  The typical recommended use
scatters strongly coupled information to distant places,
destroys modularity and discourages refactoring into
functional (reusable) units such as custom widgets and other
classes. If the interface changes dynamically and/or it
reflects some data structures (unknown at compile time),
adding libglade into that is just a recipe for headache.

> the fact that you can later dynamically change
> your UI using a designer tool without editing your source code is
> only added sugar.

Whether this is a featue or bug is yet to be determined.

> Consider that adding a user visible feature to your
> program will become a matter of:
>    a.) Adding a control widget to your GUI with a designer tool and then
>    b.) Adding a callback function that will interface with your core
>        application code to perform a task, maybe also 
>    c.) Fetching a widget pointer from the libglade built hierarchy to
>        provide the user with feedback from the core. 

The code representing the dynamics of the user interface
forms the bulk of the code, accounts for almost all the
complexity and often shares bits with construction code.
If simplifying construction -- the easy and straightforward
part -- radically simplifies your program, your program is
most likely Hello world.

c) in its typical use is global variables in disguise (a
flat pool with everything).

Yeti



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