Python voting demo discussion

A

Alan Dechert

Thanks for the interesting discussion yesterday afternoon about the voting
software development project I am working on putting together.

Almost all of the discussion had nothing to do with my question, but that's
okay. Actually, I knew it would probably go that was but I could not very
well say, "don't ask me all those other questions." It was reasonable for
you to ask.

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.

If you have anything to add regarding this specific issue, I would be
interested to hear it.

Thanks again for your time.

-- Alan Dechert
 
G

Gerrit Muller

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.
<...snip...>

The open door answer is that this type of problem can be implemented
with a low effort in Python, because of:
+ the large amount of available well working packages, such as
storage, networking etcetera
+ the low amount of syntactic overhead

It might well be that you combine a few of the options you mention: do
you store in an optimized format (binary pickle: very fast and compact),
or XML (rather bloated, but human and machine readable by any
application). Python does support these hybrid applications very well,
allowing you to explore multiple options in your prototype.

Java, C, C++ and C# will require siginificantly more lines of code and
effort to make. In the end these implementationsmight be faster, but I
don't see any performance problem at all in your application, even on
old and slow commodity PC's.

Perl might do the job, has the same benefits as mentioned above. However
in this newsgroup you will get the consistent answer that Python will
result in readable solutions and therefor updateable and maintainable
(even an issue for prototyping!), while Perl is not readable :)

PHP and (D)HTML are other approaches, focusing more on the UI part of
the problem. My own work on HTML is always generated by Python scripts :).

The only missing option is Visual Basic. Again in this newsgroup the
verdict will be the same: Python will solve it with low effort and
readable result, while VB quickly becomes a mess :)

In fact the main recommendation is: simply start in Python. You should
have something (very simple) working within 1 (one) day, with improved
implementation following quickly. The importance of having something
working in one day is to get the iteration going over all different
requirement aspects and design choices. Ah, tis is my hobbyhorse, see
a.o. (very long links, will be broken by most newsreaders!)
http://www.extra.research.philips.com/natlab/sysarch/ArchitecturalReasoningBook.pdf
on page
http://www.extra.research.philips.com/natlab/sysarch/ArchitecturalReasoning.html

regards Gerrit
 
P

Paul Rudin

Gerrit" == Gerrit Muller said:
> (very long links, will be broken by most newsreaders!)

Surrounding urls with angle brackets prevents most news/mail software
from inserting unwanted line breaks. I understand it even works with
the horrible OE!
 
I

Ian Bicking

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
 
L

L. A. Jackson

When it comes to language selection I'm of the opinion that it should
be based on the skillset and expertise available to you. If youre
proposing python and have the human resources available with python as
a skillset then go for it. If not then look closely at what
skillset/s are available and tailor language selection around that.

I will STRONGLY advise that you consider using XML (and if necessary
get or train people with the necessary expertise ) since there are
already several specifications out there ( e.g. vXML, eML) which have
looked at the requirements for voting systems. These are open
specifications and although they tend to be complex, they do massively
increase the value and portability of any data which you capture.

In addition XML has the strength of being easily transformable to
other formats via XSLT. e.g. With some design and planning you should
be able to use the same underlying data/format for output to web,
screen or printer. My initial thoughts are that you should look at SVG
for the control over onscreen output that you require and XSL for
printed documentation. Python is a suitable "glue" language for
this...see earlier comments however.

Sounds like an interesting project btw. Hope it has good auditing
features ;)

Good Luck

Lee
 
A

Alan Dechert

In fact the main recommendation is: simply start in Python. ....
I think that's what we'll do. Thank you very much for your input.

It will be on sourceforge.net very soon (today).

Alan Dechert
 
A

Alan Dechert

Ian Bicking said:
Python is quite appropriate for these sorts of
changes, certainly moreso than C and C++, and arguably C# and Java.
Thanks again, Ian. We will use Python for the demo. It will be on
sourceforge.net momentarily.

Alan Dechert
 
A

Alan Dechert

So if you want a demo, or you want to experiment with different
interfaces, you might consider using Flash or related tools and only
later, once you're ready for the next development stage, do you
worry about the actual mplementation language used for deployment.
Right. Thanks. That's what we'll do.

Alan Dechert
 
A

Andrew Dalke

Alan Dechert:
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.

Just posted a suggestion in that thread, but figured I would elaborate on it
here.

While Python can do what you want, you'll have to work through some
sort of graphics toolkit to get the screen placement and interface code.
The standard GUI toolkits (wxPython, Qt, SWING, etc.) are designed
for a windowing system with a platform-appropriate look&feel. As such,
they likely won't give you the sort of control you want over the system,
and you'll end up writing your own.

If you're going to do that, you should look at tools designed for that level
of control. There are two categories I know of. One is designed for games,
and the other for multimedia presentations. For Python, the best bet is
pygame, which uses a lower-level toolkit. There are likely bindings for
this
toolkit for other languages. However, in general I've found Python to be
a surperb language and think it would be the easiest development language
for this task.

The other option is to look for multimedia or prototyping systems. The
best example is Flash, which is often used for animations in web pages.
These can be very fancy with all sorts of novel controls, and the Flash
company (Macromedia) has their software to make it easy to develop
these applications, though I've never used them. You would also need
to verify you can print from their tools...

So if you want a demo, or you want to experiment with different
interfaces, you might consider using Flash or related tools and only
later, once you're ready for the next development stage, do you
worry about the actual mplementation language used for deployment.

Andrew
(e-mail address removed)
 

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,982
Messages
2,570,189
Members
46,734
Latest member
manin

Latest Threads

Top