Still Loving Python

S

Steve Holden

Mike said:
I didn't label them as "evil" - I agreed with someone who did that
:).




Whatever makes you think I have this need? I said I hated them. I'm
pretty sure I didn't say everyone should have to use them.

Before we descend to the level of name calling :), can I interject
another, possibly heretical, point in favour of GUI builders that you
might *both* be able to disagree with?

It isn't often done, but I quite like the idea of giving users the GUI
builder so that they can specify their preferred task interface, at
least to a first approximation.

With a good tool it's relatively easy to integrate application code
after GUI clean-up. Users sometimes find this a more intuitive way of
specifying what they want (and God knows, most users *need* better ways
of specifying what they want ...)

regards
Steve
 
S

Steve Holden

Alex said:
Try Interface Builder on a Mac: it builds interfaces as _data_ files,
not "generated code". You can then use the same UI from Objective C,
Java, Python (w/PyObjC), AppleScript... interface-painters which
generate code are a really bad idea. (I'm sure Apple's IB is not the
only interface-painter which encodes the UI as a datafile, easily
interpreted at startup by a suitable library for whatever language
you're using to flesh it out -- it's such an obviously RIGHT idea!).
You're right. For example wxDesigner will produce XML, as well as
writing wxWidgets calls directly in Python, Perl or C++.

regards
Steve
 
B

Bengt Richter

But you only need to do that if you're wanting near-absolute control
over what's displayed. Once you provide reasonable accessability and
configuration features - letting the user specifiy fonts, which
buttons show up, which toolbars you're going to have, what's in the
menus, etc. In this case, "look" is trivial, and it seldom requires a
second pass.


That is your opinion, and I'm sure it's true for you. It isn't true
for me.
De gustibus non disputandum, or whatever ;-)
Maybe you're doing something wrong? Or maybe it is tiresome for you,
and you should be using something else.


Your application creates code in the end, so that's the direct
route. A visual representation of a modern app is a relatively static
version of the real interface, and thus at best an approximation.

Worse yet, there's a good chance your visual tool stores the
information needed to recreate either the visual version or the code
in either a binary format, or a proprietary one, or both. In the
former case, standard code analysis tools are nearly useless. In the
latter case, they own your code. While that price might be worth it if
you place enough value onj being able to manipulate images instead of
code, either is enough to make me avoid a tool.
If that is your concept of Delphi, it is wrong. A text view of what you have
created visually is available. I put four buttons on a blank form with
captions per your example. The result is

object Form1: TForm1
Left = 200
Top = 108
Width = 696
Height = 480
Caption = 'Form1'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 64
Top = 48
Width = 75
Height = 25
Caption = 'New'
TabOrder = 0
end
object Button2: TButton
Left = 152
Top = 48
Width = 75
Height = 25
Caption = 'Open'
TabOrder = 1
end
object Button3: TButton
Left = 240
Top = 48
Width = 75
Height = 25
Caption = 'Save'
TabOrder = 2
end
object Button4: TButton
Left = 328
Top = 48
Width = 75
Height = 25
Caption = 'Save As'
TabOrder = 3
end
end

You see the above sort of text if you are looking at a form you are working and you press Alt-F12.
If you do not violate the format, you can edit it as text right in the window you are looking at
and round-trip it back to a visual view with another Alt-F12, and you will see the adjusted visual view.
Other aspects of objects show up too if you set non-default conditions one way or the other. E.g.,
adding an individual mouse-over hint is a matter of typing the text in a slot in the object inspector
which is automatically showing the properties of the button etc that you have visually selected
on your form/dialog. E.g., above button with hint added.

object Button4: TButton
Left = 328
Top = 48
Width = 75
Height = 25
Hint = 'Opens a file dialog for saving'
Caption = 'Save As'
ParentShowHint = False
ShowHint = True
TabOrder = 3
end

A single click compiles, links and runs the resulting independent windows .exe in a fraction of a second
for the above, and I can see the hint, kill the .exe, and go on where I was.

Of course, as you see, I could select the text and put it in the clipboard, and post it here.

BTW, Delphi also compiles and links in a blink (literally for small programs), and generates
a small .exe. Delphi also lets you code without GUI and gives you a command line compiler for
its object pascal, and you can write very small executables that way if you like, even using x86 builtin assembler.
And it compiles and links _hella_ faster than C/C++ ;-) And you can make DLLs, and link also with non-Delphi.

Not that I've used it for quite some time, though ;-)

Anyway, I wouldn't diss Delphi too casually. I don't think you would if you'd spent enough time to
get fluent in it. (I don't know what the current state of Delphi is though. I'm speaking from experience
mostly with the ancient Delphi3 whose output you see above ;-)

Regards,
Bengt Richter
 
P

Peter Decker

Whatever makes you think I have this need? I said I hated them. I'm
pretty sure I didn't say everyone should have to use them.

Sorry, but there is a world of difference between saying "I prefer X
over Y" and "Yes, Y is evil". And unless English is a second language
for you, it's insulting to imply a difference between calling
something evil and agreeing with someone who did, even if you added a
smiley.

This is a 'discussion' list. Nothing kills discussion faster than
zealots who call those who disagree with them evil or idiots or
clueless n00bs.
 
D

Daniel Crespo

Lawrence said:
ps. the customer wants Windows as a platform, we develop on Linux using
PyGTK, postgre and sql server for some old data. This is the true power of
cross-platform :)

PyGTK is crossplatform, that's true, but it looks very ugly under
Windows and don't know under MacOS (if it's supported). I couldn't find
the way for get it running with an atractive look & feel under Windows
after compiling it. Also, it needs the GTK+ Runtime Environment. I use
wxPython and it is very very very very good. It's not perfect, but IMO,
it is much better than PyGTK. PyGTK is good if you intend to develop
for Linux.

Daniel
 
M

Martin Christensen

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bengt> De gustibus non disputandum, or whatever ;-)

Yeah, and quidquid latine dictum sit, altum viditur. :)

Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using Mailcrypt+GnuPG <http://www.gnupg.org>

iEYEARECAAYFAkOgIuoACgkQYu1fMmOQldULYwCgjZovLw/gTJ8I/z/Wem203aca
DUUAoJ7GNNn2QOrmFINrgw58OkRnBmJU
=mUHX
-----END PGP SIGNATURE-----
 
T

TwistyCreek

Peter said:
Sorry, but there is a world of difference between saying "I prefer X over
Y" and "Yes, Y is evil". And unless English is a second language for you,
it's insulting to imply a difference between calling something evil and
agreeing with someone who did, even if you added a smiley.

This is a 'discussion' list. Nothing kills discussion faster than zealots
who call those who disagree with them evil or idiots or clueless n00bs.

Except maybe anal retentive prats who argue semantics to cover up the fact
that they wouldn't know a for loop from a foreskin.

And by the by... visual tools ARE evil. <nfgaa>

It's like your dad getting his drunken bar buddies to plow your mother
because he's too fat to do it himself. The unfortunate offspring of any
such union is equally the bastard be it human or machine. It will have
this queer tendency to have the same eyes as the guy over in the corner,
luxuriating in a puddle of his own urine.
 
L

Lawrence Oluyede

Il 2005-12-14 said:
PyGTK is crossplatform, that's true, but it looks very ugly under
Windows and don't know under MacOS (if it's supported).

You can use themes. Under MacOSX you have to install X11, but a native
version in on the way.
I couldn't find
the way for get it running with an atractive look & feel under Windows
after compiling it. Also, it needs the GTK+ Runtime Environment. I use
wxPython and it is very very very very good. It's not perfect, but IMO,
it is much better than PyGTK. PyGTK is good if you intend to develop
for Linux.

So wxPython doesn't need a runtime? I don't think so. wxPython for me
sucks under Linux (built on gtk2) and I don't like its API at all. It
seems a bit awkward to me. Anyway... what do you mean with "much better" ?
 
P

Peter Decker

And by the by... visual tools ARE evil. <nfgaa>

It's like your dad getting his drunken bar buddies to plow your mother
because he's too fat to do it himself. The unfortunate offspring of any
such union is equally the bastard be it human or machine. It will have
this queer tendency to have the same eyes as the guy over in the corner,
luxuriating in a puddle of his own urine.

Wow, I can't think of a response that would make you look more
clueless than what you just wrote.

And thank you for making my point: zealots have no place in a
discussion list, since they are incapable of discussing.
 
S

Steve Holden

TwistyCreek said:
Peter Decker wrote:

Sorry, but there is a world of difference between saying "I prefer X over
Y" and "Yes, Y is evil". And unless English is a second language for you,
it's insulting to imply a difference between calling something evil and
agreeing with someone who did, even if you added a smiley.

This is a 'discussion' list. Nothing kills discussion faster than zealots
who call those who disagree with them evil or idiots or clueless n00bs.


Except maybe anal retentive prats who argue semantics to cover up the fact
that they wouldn't know a for loop from a foreskin.

And by the by... visual tools ARE evil. <nfgaa>

It's like your dad getting his drunken bar buddies to plow your mother
[...] in a puddle of his own urine.
And that's quite enough of that, thanks.

regards
Steve
 
M

Mike Meyer

A single click compiles, links and runs the resulting independent windows .exe in a fraction of a second
for the above, and I can see the hint, kill the .exe, and go on where I was.

Click? Yuck. If I wanted it, I've had environments where a single
keystroke (much better) compiled, linked and ran the resulting
app. Not in a fraction of a second, but that's sort of irrelevant to
the GUI/non-GUI question.

<mike
 
M

Mike Meyer

Peter Decker said:
Sorry, but there is a world of difference between saying "I prefer X
over Y" and "Yes, Y is evil". And unless English is a second language
for you, it's insulting to imply a difference between calling
something evil and agreeing with someone who did, even if you added a
smiley.

I don't agree. I do apologize, though - no insult as intended.
This is a 'discussion' list. Nothing kills discussion faster than
zealots who call those who disagree with them evil or idiots or
clueless n00bs.

There's also a world of difference between saying "X is evil" and
saying "users of X are evil." Unless English is a second language for
you, going from a statement about X to a statement about is users of X
is insulting.

<mike
 
D

Daniel Crespo

So wxPython doesn't need a runtime? I don't think so. wxPython for me
sucks under Linux (built on gtk2) and I don't like its API at all. It
seems a bit awkward to me. Anyway... what do you mean with "much better" ?

It's much better:
- Its portability is superior over PyGTK
- Its look & feel is superior over PyGTK (except in Linux)

Under windows, only needs some dlls (they are its runtime), and works
perfect. The same exe works on Win98, ME, 2000, XP. Of course that
there are some differences between these OSs.

I tried both a lot, and I stay with wxPython :)
 
P

Paul Boddie

Alex said:
Try Interface Builder on a Mac: it builds interfaces as _data_ files,
not "generated code". You can then use the same UI from Objective C,
Java, Python (w/PyObjC), AppleScript... interface-painters which
generate code are a really bad idea.

Well, my limited experience with Qt Designer suggests that it
principally generates XML-based user interface descriptions. In Qt 3's
Designer, there are various callback editing windows which assume that
you're entering C++, but I haven't needed to use them myself, and these
may actually have been removed in Qt 4's Designer (although I haven't
begun to investigate that yet).

I imagine that Jérôme was referring to code generated by pyuic. Of
course, there are various extensions for PyQt which let you build the
user interface directly from the XML-based descriptions.

Paul

P.S. Why does Google Groups have to mangle Jérôme's name and, while
we're on the subject, when are they going to at least implement
autoquoting of the message being responded to? Sigh!
 
L

Lawrence Oluyede

Il 2005-12-14 said:
Under windows, only needs some dlls (they are its runtime), and works
perfect. The same exe works on Win98, ME, 2000, XP. Of course that
there are some differences between these OSs.

It's the same for Gtk
I tried both a lot, and I stay with wxPython :)

:)
 
B

Brian van den Broek

Peter Decker said unto the world upon 2005-12-14 07:03:
Sorry, but there is a world of difference between saying "I prefer X
over Y" and "Yes, Y is evil". And unless English is a second language
for you, it's insulting to imply a difference between calling
something evil and agreeing with someone who did, even if you added a
smiley.

This is a 'discussion' list. Nothing kills discussion faster than
zealots who call those who disagree with them evil or idiots or
clueless n00bs.

It seems to me that long tradition has it that "evil" in a context
such as this really is not that strong a term. See
<http://www.catb.org/jargon/html/E/evil.html>.

If you knew that and were still objecting, sorry for the noise.

Best,

Brian vdB
 
M

Magnus Lycka

Peter said:
If you design a moderately complex UI a designer will be faster. It's
not the speed of typing vs. dragging that matters. You see the result
instantly and don't have to start your program, look, type code, start
again and so on. A GUI builder is more pleasant to work with, at least
with a good one like Delphi or Qt designer.

I haven't worked terribly much with GUI design, but I've written
a few GUI programs using both approaches, and I've used Rational
Rose to generate C++ code from object models quite a lot.

It's my impression that code generation leads to more duplication
and less code reuse. It's easy to whip up a new class or window
that duplicates a lot of already existing code, with those graphical
tools.

These tools encourage a development style similar to the copy-paste
programming style, and that leads to a big maintenance burden in
a longer perspective. Refactoring gets harder, and maintenance
suffers if the original information concerning the software is
split between source code and other repositories that are used for
the generation of programming code.

It's also my impression that these code generating tools don't
scale so well. When projects get bigger, tools that potentially
influence many source files, sometimes causing unnecessary changes
due to the way they are implemented, will create havoc in the
configuration management systems. There will be blocking locks
or conflicts that needs to be sorted out, making it hard for
programmers to work in parallel on the same components, and more
difficult to track relevant changes between versions in the
software. This makes it even harder than otherwise to increase
development speed by adding more people to a project etc.

Besides the fact that it's quick to generare yet another bunch
of files, these tools typically impose constrains that makes it
more difficult to use otherwise clever design approaches that
would lead to an effective implementation. This has bitten me
both with GUI designers and when I used Rational Rose and Plugins
for that. For instance there were features in some APIs that
were difficult to employ because they weren't supported by our
code generation plugin for Rose.

I also found that it's easy in Python to make fairly thin GUIs
with test stubs that can be fired up and tested quickly during
development.

If you e.g. have several similar Windows, it's easy with properly
written OO Python code to write a main module that supports all
the shared features, and a tiny module for each variant of the
Window that subclasses the main module. With the GUI designers
I used, the typical approach would not involve that kind of
code sharing.
 
?

=?iso-8859-1?q?J=E9r=F4me_Laheurte?=

It's much better:
- Its portability is superior over PyGTK

Mmmh, I haven't used pyGTK a lot so I can't really compare them but in my
experience wxPython is very unstable on anything but Windows (in fact it's
not wxPython's fault but wxWidget's of course)... Seems to have gotten
better with newer releases.
- Its look & feel is superior over PyGTK (except in Linux)

No, its look & feel is the one of the underlying platform, though I think
the term "underlying platform" has meaning only on Windows and MacOS. Of
course a Windows user will be more at ease with a wx application than with
a GTK one, but that doesn't mean Windows look & feel is better than GTK
(maybe it is, but I think it's a matter of taste).
Under windows, only needs some dlls (they are its runtime), and works
perfect. The same exe works on Win98, ME, 2000, XP. Of course that
there are some differences between these OSs.

I concur, wxPython is perfect for Windows apps. It's far less than perfect
for Linux though, and I haven't tried it on MacOS yet.

Shameless plug: I once wrote a rant about wxPython (warning: flame
material ahead):

http://fraca7.free.fr/blog/index.php?2005/04/04/10-a-word-about-guis
 
?

=?iso-8859-1?q?J=E9r=F4me_Laheurte?=

I imagine that Jérôme was referring to code generated by pyuic. Of
course, there are various extensions for PyQt which let you build the
user interface directly from the XML-based descriptions.

Indeed, that's what I meant. I should have been a bit more explicit.
P.S. Why does Google Groups have to mangle Jérôme's name

I didn't see anything wrong... Encoding problem ?
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top