[Glade-devel] Source code generation
Tristan Van Berkom
tvb at gnome.org
Tue Oct 17 09:40:57 EDT 2006
Magnus Bergman wrote:
> I guess this has been brought up many times before, but I'm new to this
> list and missed the discussions.
>
> What I wonder is why source code generation is deprecated? Is it just
> that the code in glade was deprecated (not up to date and not
> maintained perhaps) or is the whole idea of generating code considered
> deprecated? I think it's nice. But would really prefer to have a
> command line tool to do the job (so I actually have nothing against it
> being removed from glade). Is there any reason why I shouldn't get
> going and create such a tool right away?
Historically - people have generally found it much easier to
maintain a project that loads a glade file than a project that
uses generates sources - mostly because of the pain of merging
sources every time the UI might change, using libglade removes
this stubmling block from your work and additionally gives you
a dynamic UI that can be modified without recompiling your app.
Glade 3 was designed to externalize the task of code generation
(as it has a modular design it should do as little as possible
outside of creating glade files - it should create glade files
_well_), it was planned that "if people want code generation -
they can generate code from glade files".
That being said; I personally dont think it wise to encourage
people to use generated source files in thier project, when all
that generated code can be replaced by 3 or 4 lines of libglade
code and a glade file.
Why not talk to the Anjuta folks about this ?
... generating code for signal callbacks from an ide could be
cool right ?
My 2 cents on the issue also is - if there is to be code generation
at all, there should be some kind of unified api - maybe code
generators should be plugins to an IDE, maybe the IDE should be able
to use the same semantics to generate "creation code"/"signal callback
code" for both the C# and python (and other...) generators.
Cheers,
-Tristan
/me is getting the hang of answering this one ;-)
More information about the Glade-devel
mailing list