python coding contest

Christian Tismer tismer at stackless.com
Tue Dec 27 20:32:29 EST 2005


James Tanis wrote:
> On 12/25/05, Simon Hengel <simon at airlangen.de> 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.

Looking at what I produced the last days, I'm not convinced...

> .. yes but there's a difference, some users of that "other" P-language
> seem to actually take some sort of ritualistic pride in their ability
> to condense code  down to one convoluted line. The language is also a
> little more apt at it since it has a great deal of shorthand built in
> to the core language. Shorter is not necessarily better and I do
> support his opinion that reinforcing short as good isn't really what
> most programmers (who care about readability and quality) want to
> support.

And that's what puzzled me a bit about the approach and the intent
of this contest: Should this evolute into a language war about
goals (shortness, conciseness, brevity, whatnot) that Python
doesn't have as its main targets?
Sure, I see myself hacking this unfortunate little 7-seg code
until it becomes unreadable for me, the trap worked for me,
but why do I do this???

...

> I think code efficiency would be a better choice. A "longer" program
> is only worse if its wasting cycles on badly implemented algorithms.

And we are of course implementing algorithms with a twisted goal-set
in mind: How to express this the shortest way, not elegantly,
just how to shave off one or even two bytes, re-iterating the
possible algorithms again and again, just to find a version that is
lexically shorter? To what a silly, autistic crowd of insane people
do I belong? But it caught me, again!

> Code size is a really bad gauge, If your actually comparing size as in
> byte-to-byte comparison, you'll be getting a ton of implementations
> with absolutely no documentation and plenty of one letter variable
> names. I haven't checked the web site either, are you allowing third
> party modules to be used? If so, that causes even more problems in the
> comparison. How are you going to compare those who use a module vs
> implement it themselves in pure python?

I think it is legal to use any standard pre-installed package you
like, if it belongs to the set of default batteries included.
In a sense, using these tools in a good manner, gives you some
measure about how much the programmer knows about these batteries,
and using them is ok. Actually, I don't see so much applications
for the given problem, but in general, I like the idea to try
many very different approaches to get to a maybe surprizing result.

After all, I'd really love to set up another contest with
different measures and criteria.

One reason btw. might be that I'm not able to win this one, due to
personal blocking. I can't really force myself to go all the
ridiculous paths to save one byte. My keyboard blocks as well.
Maybe I don't consider myself a hacker so much any longer :-)

ciao - chris
-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
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/



More information about the Python-list mailing list