Re: python coding contest

Discussion in 'Python' started by Christian Tismer, Dec 25, 2005.

  1. 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 :^) <mailto:>
    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/
     
    Christian Tismer, Dec 25, 2005
    #1
    1. Advertising

  2. Christian Tismer <> 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
     
    Alex Martelli, Dec 25, 2005
    #2
    1. Advertising

  3. Christian Tismer

    Simon Hengel Guest

    > 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/
     
    Simon Hengel, Dec 26, 2005
    #3
  4. 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 :^) <mailto:>
    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/
     
    Christian Tismer, Dec 26, 2005
    #4
  5. Christian Tismer <> 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
     
    Alex Martelli, Dec 26, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Hengel

    python coding contest

    Simon Hengel, Dec 25, 2005, in forum: Python
    Replies:
    23
    Views:
    737
    Claudio Grondi
    Jan 2, 2006
  2. Simon Hengel

    Re: python coding contest

    Simon Hengel, Dec 25, 2005, in forum: Python
    Replies:
    92
    Views:
    1,460
    Alex Martelli
    Jan 2, 2006
  3. Tim Hochberg

    Re: python coding contest

    Tim Hochberg, Dec 25, 2005, in forum: Python
    Replies:
    3
    Views:
    304
    Alex Martelli
    Dec 26, 2005
  4. Tim Peters

    Re: python coding contest

    Tim Peters, Dec 26, 2005, in forum: Python
    Replies:
    0
    Views:
    442
    Tim Peters
    Dec 26, 2005
  5. Jean-Paul Calderone

    Re: python coding contest

    Jean-Paul Calderone, Dec 27, 2005, in forum: Python
    Replies:
    2
    Views:
    294
    Tim Hochberg
    Dec 28, 2005
Loading...

Share This Page