XRC vs Perl (GUI) generated code

K

king kikapu

Hi,

i posted this to the perl.beginners group yesterday morning but it
seems it got lost...
Anyway.

I have started using Perl and i quite like it!

As i come from the Windows world, i started looking about my GUI
options and decided to use wxWidgets.
So, i know that there is wxGlade that produce Perl code but i found
some other very nice tools (wxFormDesigner, DialogBlocks and some
other) too that they seem to be better than wxGlade (more controls,
more stable) only that they generate XRC code.

My question is:
Can i use this XRC generated code from (wx)Perl easily so to display
the GUI ?
And in general, is it better to use tools (like wxGlade) that generate
directly Perl code or using some more advanced ones but produce XRC ?
What is the advantages of each option ?

Thanks a lot for any help on this,

K.K.
 
S

smallpond

Hi,

i posted this to the perl.beginners group yesterday morning but it
seems it got lost...
Anyway.

I have started using Perl and i quite like it!

As i come from the Windows world, i started looking about my GUI
options and decided to use wxWidgets.
So, i know that there is wxGlade that produce Perl code but i found
some other very nice tools (wxFormDesigner, DialogBlocks and some
other) too that they seem to be better than wxGlade (more controls,
more stable) only that they generate XRC code.

My question is:
Can i use this XRC generated code from (wx)Perl easily so to display
the GUI ?
And in general, is it better to use tools (like wxGlade) that generate
directly Perl code or using some more advanced ones but produce XRC ?
What is the advantages of each option ?

Thanks a lot for any help on this,

K.K.


First off, wxWidgets is an excellent toolkit.

Using wxGlade is the obvious choice for someone
with a Windows background.
It protects you from things not commonly done on
Windows like checking return values of calls, looking at
error messages, and reading documentation.

Some folks on this group might suggest that you just
use the Wx perl module and code your UI from the
ground up. Nonsense! You would actually have to
learn how the various subsystems work and interact.
Then when you have a problem, you would be the one stuck
fixing it instead of just being able to throw your
hands up and walk away.

HTH
 
K

king kikapu

First off, wxWidgets is an excellent toolkit.

Using wxGlade is the obvious choice for someone
with a Windows background.
It protects you from things not commonly done on
Windows like checking return values of calls, looking at
error messages, and reading documentation.

Some folks on this group might suggest that you just
use the Wx perl module and code your UI from the
ground up.  Nonsense!  You would actually have to
learn how the various subsystems work and interact.
Then when you have a problem, you would be the one stuck
fixing it instead of just being able to throw your
hands up and walk away.

HTH

Hey, thanks for the reply!

I plan to use wxGlade (or some sort of form designer, i would never
code the UI by hand) but what are the differences by using Perl
generated code and XRC one ?
 
R

RedGrittyBrick

king said:
Hey, thanks for the reply!

I plan to use wxGlade (or some sort of form designer, i would never
code the UI by hand)

Sarcasm detector failure detected!
 
C

ccc31807

I have started using Perl and i quite like it!

Perl is a great tool to use for a few things, like database stuff,
data manipulation, and user interfaces using a browser including web
sites. However, it's not the best tool for everything in the world,
and you will do well to match the tool to the task at hand.
As i come from the Windows world, i started looking about my GUI
options and decided to use wxWidgets.

Most of the stuff I do is Windows based, as I work in a 100% Microsoft
shop (except for me.) Once or twice I have tried to build a GUI app
with Perl, but Java is much better for this, or .NET. All of the GUI
apps I write are webified, and the users interact with the app using a
browser. This really is the way of the future (IMO) and (IMO) you
would do well to learn how to webify your own applications.
And in general, is it better to use tools (like wxGlade) that generate
directly Perl code or using some more advanced ones but produce XRC ?
What is the advantages of each option ?

HTML, CSS, and Javascript is easy enough to write by hand, using
Notepad, or vi (gVim for Windows). I don't know what you are doing,
and I certainly wouldn't suggest that these kinds of tools don't have
their place, but for the simple things I do, I can use vi or a similar
tool faster and more accurately than a point and click tool, like VS
(for example). Mostly, you can build your own HTMLized components, put
them in a module, and call them when you need them.

CC
 
K

king kikapu

Thanks for the replies, but...

I do not want an opinion if "Perl is good at this but bad at that", if
"GUIs are better in .net than Perl" etc etc...
I have a 9 years experience in .NET and C# and i just want to master a
cross-platform language like Perl.

My question is, really, very specific:
"Can i, easily, use XRC code that is generated from GUI Builder tools
or is it better to use Perl generated code from wxGlade ?
What is the positives/negatives of using XRC code from my Perl
script ?"
 
R

RedGrittyBrick

king said:
Thanks for the replies, but...

I do not want an opinion if "Perl is good at this but bad at that", if
"GUIs are better in .net than Perl" etc etc...
I have a 9 years experience in .NET and C# and i just want to master a
cross-platform language like Perl.

My question is, really, very specific:
"Can i, easily, use XRC code that is generated from GUI Builder tools
or is it better to use Perl generated code from wxGlade ?
What is the positives/negatives of using XRC code from my Perl
script ?"

It seems you aren't getting the number and/or quality of responses you
were hoping for. It may be that the reason is that only a small
proportion of Perl programmers write desktop GUI programs in Perl. It
might be that most Perl programmers write either command-line programs
or web-based programs with an HTML based user interface.

In your shoes, after reconsidering Perl vs Java, C# etc, I'd write a
small Perl program using each of WxGlade, wxFormDesigner and
DialogBlocks. I'd use that experience, and any evidence of relative
popularity, to decide between them. YMMV.

You could then share your conclusions here or on a web-page. Just my
¤0.02 worth.
 
K

king kikapu

It seems you aren't getting the number and/or quality of responses you
were hoping for. It may be that the reason is that only a small
proportion of Perl programmers write desktop GUI programs in Perl.

Hmmm...that's true. But because Perl has become a generic programming
language (long ago), i just want to push it and create a variety of
software, not just console programs. And that includes GUI stuff.
Alas, we all use graphical environments these days...
In your shoes, after reconsidering Perl vs Java, C# etc, I'd write a
small Perl program using each of WxGlade, wxFormDesigner and
DialogBlocks. I'd use that experience, and any evidence of relative
popularity, to decide between them. YMMV.

You could then share your conclusions here or on a web-page. Just my
¤0.02 worth.

Nice direction and thank you for this. Because all of this take some
time, i just hoped that someone who used both ways (generated Perl/XRC
code), could shed some light and give me some hints...
 
C

ccc31807

"GUIs are better in .net than Perl" etc etc...
I have a 9 years experience in .NET and C# and i just want to master a
cross-platform language like Perl.

Do you want to know whether a hammer is good at installing screws, or
bolts? Or if a screwdriver is good at installing nails or bolts? Perl
(IMO) is a rifle, good at a small slice of tasks ... witness its name,
the Practical Extraction & Reporting Language. If you want to do data
extraction, manipulation, reformatting, and reporting, Perl is a good
choice. It might be a poor choice for other kinds of jobs.
My question is, really, very specific:
"Can i, easily, use XRC code that is generated from GUI Builder tools
or is it better to use Perl generated code from wxGlade ?
What is the positives/negatives of using XRC code from my Perl
script ?"

I don't know. I don't build GUI apps with Perl, and I don't know
anyone who does. My guess would be that anyone who does so might be a
masochist. If I wanted to build a GUI app, I'd either use Java
or .NET.

You didn't ask this, but FWIW, my feeling is that GUI apps in general
are a dying breed. Where I work, a large state university, all the
apps we've gotten in the last four years have been web apps, with the
sole exception of the database applications we use. I work in IT, and
pushing apps to clients, several thousand in our case, is for the
birds or the insane. Much easier to put an app on a server and let the
client connect to it with a browser. It's not up to me to judge your
intention in building a GUI app, and if you have a killer app that
will make you millions, I sincerely wish you all the best. But my take
as one who likes to stay in touch with what is going on in various
communities (Perl included) is that using Perl for building GUI apps
doesn't constitute a big sector of Perl programming and is becoming a
smaller sector of other programming technologies.

I may be wrong, and if so I'll be told that I'm wrong, but I'd be
willing to bet that I'm not. In any case, I don't want to insult you
or discourage you. I'm just offering my opinion without making any
kind of judgment on your efforts.

CC
 
C

ccc31807

Alas, we all use graphical environments these days...

We do? This is news to me. About 95% of the scripts I write run on the
CLI, and many of them run as cron jobs or as scheduled tasks. The
usual formulation is that GUIs constitute 80% of the complexity of an
application but only 20% of the functionality.

As a database guy, I churn out scripts that produce a variety of
output files (CSV, PDF, XLS, RTF, XML, TXT, etc.) from a variety of
input files, all done on the CLI, and my customers think I walk on
water. Thanks to Perl.

CC
 
K

king kikapu

Do you want to know whether a hammer is good at installing screws, or
bolts? Or if a screwdriver is good at installing nails or bolts? Perl
(IMO) is a rifle, good at a small slice of tasks ... witness its name,
the Practical Extraction & Reporting Language. If you want to do data
extraction, manipulation, reformatting, and reporting, Perl is a good
choice. It might be a poor choice for other kinds of jobs.

I think Perl has become a general programming language and that
"extraction and reporting" section was only meant when Perl started,
now Perl is way beyond that.
I have also used Python and saw that it can be used for virtually
everything
and so i do think for Perl.
The fact that you can do something more easily in java (GUI) doesn't
mean
that it is impossible or poor choice in Perl.
wxWidgets is a very nice option in this matter and form designers
already
exists!

You didn't ask this, but FWIW, my feeling is that GUI apps in general
are a dying breed. Where I work, a large state university, all the
apps we've gotten in the last four years have been web apps, with the
sole exception of the database applications we use. I work in IT, and
pushing apps to clients, several thousand in our case, is for the
birds or the insane. Much easier to put an app on a server and let the
client connect to it with a browser. It's not up to me to judge your
intention in building a GUI app, and if you have a killer app that
will make you millions, I sincerely wish you all the best. But my take
as one who likes to stay in touch with what is going on in various
communities (Perl included) is that using Perl for building GUI apps
doesn't constitute a big sector of Perl programming and is becoming a
smaller sector of other programming technologies.


I agree with you for the web trend and in fact, is is on my mind to
spend
more time to learn to program web apps with Perl.
But web apps simply cannot do many of the things that desktop apps do,
desktop has myriad of options that the web does not have right now...
 
C

ccc31807

I think Perl has become a general programming language and that
"extraction and reporting" section was only meant when Perl started,
now Perl is way beyond that.

We disagree. That's not to say that your are wrong, you may very well
be right and I may be wrong, but nevertheless I think that Perl isn't
well suited for general programming.
I have also used Python and saw that it can be used for virtually
everything
and so i do think for Perl.

I've used Python as well, but form my job, Perl allows me to write
little scripts easier and quicker than I can do with Python.
The fact that you can do something more easily in java (GUI) doesn't
mean
that it is impossible or poor choice in Perl.

If you can do it easier in Java, I would argue that Java is a 'better'
choice.

I agree with you for the web trend and in fact, is is on my mind to
spend
more time to learn to program web apps with Perl.

I've also written web apps with JSP and Servlets, and I can tell you
from experience that Perl is a better choice. I'm working now on an
app that was originally written in Java that took a year, cost $30,000
and still didn't work. I'm rewritting it in Perl, have billed the
client $1,050 so far, and in three weeks have almost almost programmed
all the functionality that was in the Java version. (Not because I'm
using Perl, the requirements changed rather dramatically and Perl was
just a good fit for the changed requirements.)
But web apps simply cannot do many of the things that desktop apps do,
desktop has myriad of options that the web does not have right now...

True, but the administrative headaches are bigger. It's a tradeoff,
but I'd bet that for most of the usual stuff, a web app can to all it
needs to, and the surplus provided by stand alone apps isn't cost
efficient.

Don't get me wrong -- Perl is a genuine pearl for certain kinds of
things. IMO general purpose programs aren't one of those kinds of
things.

CC
 
C

ccc31807

Is this the royal we?

No. ;-)

Maybe I should have said that 'I' disagree with you, that 'we'
disagree among ourselves.

I coming off of two big projects, a rare case for me. One's almost
finished and the other is just over half finished. One is a data
intensive project while the other is an interface intensive project
with lots and lots of little pieces of data floating around. My
reaction is that now I wish I had used Java for the second project,
which is much closer to a traditional stand alone app that a web app.
Maybe my personal feeling about these two projects is influencing what
I have said previously in this thread. I use Perl for the majority of
my work, but there are some things (in my work) that Perl isn't suited
for.

CC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top