Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: python coding contest

Reply
Thread Tools

Re: python coding contest

 
 
Christian Tismer
Guest
Posts: n/a
 
      12-25-2005
Simon Hengel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>> I'm envisioning lots of convoluted one-liners which
>> are more suitable to a different P-language...

> I feel that python is more beautiful and readable, even if you write
> short programs.
>
>> How about """best compromize between shortness and readibility
>> plus elegance of design"""?

> I would love to choose those criteria for future events. But I'm not
> aware of any algorithm that is capable of creating a ranking upon them.
> Maybe we can come up with a solution. Any ideas?


Me neither

Maybe a compromize proposal could be like this:

- Squeezing many lines into one using semicola does not help,
the program will be expanded to use one statement per line

- blank lines are allowed and not counted if they are not
needed as part of the code

- the length of names does not count, unless the code depends on it.

Some harmonization procedure might be applied to every solution
before counting lines, in order to avoid spectacular cryptic stuff.

I have no idea whether I'm serious about this.
Having this said, I'm trashing my one-liner )

if-it-doesn't-look-like-Python-it-is-not-Python - ly y'rs -- chris
--
Christian Tismer :^) <(E-Mail Removed)>
tismerysoft GmbH : Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A : *Starship* http://starship.python.net/
14109 Berlin : PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56 mobile +49 173 24 18 776 fax +49 30 80 90 57 05
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/
 
Reply With Quote
 
 
 
 
Alex Martelli
Guest
Posts: n/a
 
      12-25-2005
Christian Tismer <(E-Mail Removed)> wrote:
...
> Maybe a compromize proposal could be like this:
>
> - Squeezing many lines into one using semicola does not help,
> the program will be expanded to use one statement per line
>
> - blank lines are allowed and not counted if they are not
> needed as part of the code


I would suggest that all whitespace (except within string literals)
should be ignored, as well.

Alex
 
Reply With Quote
 
 
 
 
Simon Hengel
Guest
Posts: n/a
 
      12-26-2005
> I would suggest that all whitespace (except within string literals)
> should be ignored, as well.

Good point, but i assume that is not possible with regular expressions.

Cheers, Simon

--
python coding contest - http://www.pycontest.net/
 
Reply With Quote
 
Christian Tismer
Guest
Posts: n/a
 
      12-26-2005
Simon Hengel wrote:
>> I would suggest that all whitespace (except within string literals)
>> should be ignored, as well.


> Good point, but i assume that is not possible with regular expressions.


No, but a trivial task using the compiler.

they should have taken this as a second challenge -- chris

--
Christian Tismer :^) <(E-Mail Removed)>
tismerysoft GmbH : Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A : *Starship* http://starship.python.net/
14109 Berlin : PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56 mobile +49 173 24 18 776 fax +49 30 80 90 57 05
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/
 
Reply With Quote
 
Alex Martelli
Guest
Posts: n/a
 
      12-26-2005
Christian Tismer <(E-Mail Removed)> wrote:

> Simon Hengel wrote:
> >> I would suggest that all whitespace (except within string literals)
> >> should be ignored, as well.

>
> > Good point, but i assume that is not possible with regular expressions.

>
> No, but a trivial task using the compiler.


Actually, the tokenize module of the standard library is plenty for this
(and any other merely lexical-level task).

> they should have taken this as a second challenge -- chris


I guess there can be more challenges, particularly because I don't think
having the prize is really that important -- one does it for fun and
kudos (a nicely designed, color-printed certificate of victory, suitable
for framing and displaying prominently, would be better, if there are
funds to make it, than a keyboard which one might not use....


Alex
 
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
python coding contest Simon Hengel Python 23 01-02-2006 07:45 AM
Re: python coding contest Simon Hengel Python 92 01-02-2006 01:04 AM
Re: python coding contest Jean-Paul Calderone Python 2 12-28-2005 02:49 PM
Re: python coding contest Tim Peters Python 0 12-26-2005 03:28 AM
Re: python coding contest Tim Hochberg Python 3 12-26-2005 02:54 AM



Advertisments