Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python voting demo discussion

Reply
Thread Tools

Python voting demo discussion

 
 
Alan Dechert
Guest
Posts: n/a
 
      07-21-2003
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



 
Reply With Quote
 
 
 
 
Gerrit Muller
Guest
Posts: n/a
 
      07-21-2003
Alan Dechert wrote:
<...snip...>

> 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.co...soningBook.pdf
on page
http://www.extra.research.philips.co...Reasoning.html

regards Gerrit
--
Gaudi systems architecting:
http://www.extra.research.philips.com/natlab/sysarch/

 
Reply With Quote
 
 
 
 
Paul Rudin
Guest
Posts: n/a
 
      07-21-2003
>>>>> "Gerrit" == Gerrit Muller <(E-Mail Removed)> writes:

> (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!
 
Reply With Quote
 
Ian Bicking
Guest
Posts: n/a
 
      07-21-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



 
Reply With Quote
 
L. A. Jackson
Guest
Posts: n/a
 
      07-21-2003
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

On Mon, 21 Jul 2003 07:44:42 GMT, "Alan Dechert"
<(E-Mail Removed)> wrote:

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


 
Reply With Quote
 
L. A. Jackson
Guest
Posts: n/a
 
      07-21-2003
"XML don't really count"

Nor should dimpled chads *grin*

On 21 Jul 2003 04:30:55 -0500, Ian Bicking <(E-Mail Removed)>
wrote:

>XML don't really count


 
Reply With Quote
 
Alan Dechert
Guest
Posts: n/a
 
      07-21-2003
"Gerrit Muller" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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


 
Reply With Quote
 
Alan Dechert
Guest
Posts: n/a
 
      07-21-2003
"Ian Bicking" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
Alan Dechert
Guest
Posts: n/a
 
      07-21-2003

"Andrew Dalke" <(E-Mail Removed)> wrote in message
news:bfh8rt$3v$(E-Mail Removed)...

> 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


 
Reply With Quote
 
Andrew Dalke
Guest
Posts: n/a
 
      07-21-2003
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
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wxPython demo /Process does not open new demo Andy Leszczynski Python 1 02-18-2005 06:03 PM
PyOpenGL demo in wxPython demo crashes F. GEIGER Python 9 05-03-2004 04:43 PM
Python - PC based Voting Machine Project Announcement Alan Dechert Python 0 08-08-2003 03:35 PM
Voting Project Needs Python People Alan Dechert Python 23 08-02-2003 02:08 AM
Possible use of Python for a voting machine demo project -- your feedback requested Alan Dechert Python 29 07-23-2003 02:04 AM



Advertisments