Python voting demo discussion

Ian Bicking ianb at colorstudy.com
Mon Jul 21 05:30:55 EDT 2003


On Mon, 2003-07-21 at 02:44, Alan Dechert wrote:
> Ian Bicking and Andrew Dalke did say they thought Python should be fine for
> the demo but I didn't get much detail about why we should prefer it over
> some of the other possibilities:  HTML, XML, Perl, Java, PHP, C, C++, C#, C,
> etc.

Well, all of the complexity of you application lies in rendering and UI
logic -- the underlying logic of doing a vote is rather simple.  It's
highly likely that you will want to change both rendering and UI logic
as you progress on this.  Python is quite appropriate for these sorts of
changes, certainly moreso than C and C++, and arguably C# and Java.

PHP is tied closely to rendering for the web in a client/server
fashion.  While you may wish to do this, you may not, and you don't
really want to tie yourself to that model.

Perl's there's-more-than-one-way-to-do-it motto is a very bad fit for
this program.  You want a program that is auditable, and Perl is poor at
this.

HTML and XML don't really count -- you may wish to use those (or not),
but you'll still need a programming language.

If you want even a nominally Open Source system, C# is out.  Technically
Mono exists, but the only real development environment you'd have is
Windows/Microsoft.  I don't believe there's any Open Source community,
or significant libraries (but that's mostly conjecture). 

With all this, I think you are left with Python, Java, and maybe
Javascript.  Performance is not an issue in this application.  Python is
faster to develop with, and is particularly faster in terms of ramp-up
time (which is what the demo involves).  The major obstacle is
rendering, as I see it.  ReportLab makes rendering the print document
fairly easy, and I'm sure similar Java libraries exists.  

Since you don't seem to want to use normal GUI toolkits (and they don't
seem appropriate), you will be off the beaten track to some degree. 
Pygame offers support, but there's still quite a bit of work involved in
handling it.  On the positive side, you'll have a high amount of
control, as Pygame can take over the screen nicely.  I know very little
about the Java world, so I have no idea what you might use there.

If you use HTML in some fashion (i.e., a browser), you will find
rendering a *lot* easier.  You can get decent control so long as you are
working with just one version of one browser, which is entirely
reasonable.  Some toolkits have HTML rendering widgets -- I have no idea
of their quality or applicability, but it's certainly something worth
investigating.  Otherwise you may want to use Javascript and program the
entire thing that way (possible generating the Javascript at some level
-- something that might be appropriate for Python).  It's a little odd,
and I don't know exactly how to go about it, but I'm pretty sure it is
possible.

There might be ways you can use a library to render to a pixmap, and use
these inside pygame.  But what that library might be, I'm not sure.

  Ian







More information about the Python-list mailing list