python coding contest
Remi Villatel
maxilys at SPAMCOP_tele2.fr
Tue Dec 27 23:12:22 EST 2005
Christian Tismer wrote:
>>> 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...
Me neither. Especially since I've taken the one-liner road. Python can
be very unreadable... sometimes.
> 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?
Maybe to prove to the others that Python is a "real" language that can
produce "uglinesses" too?
> 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???
For the pleasure of twisting your mind in every possible way, for the
challenge, for the luxury price if you win? Whatever... I'm trapped too
and I can't give any reason off the top of my head.
[---CUT---]
> I think it is legal to use any standard pre-installed package you
> like, if it belongs to the set of default batteries included.
[---CUT---]
If you use more than the built-ins, you've already lost. It costs you at
least 9 bytes, well, 10 since I don't know any module with a
single-letter name.
"\t"+"import"+" "+name_of_module+"\n"
And knowing how much I struggled to remove the last 10 bytes I removed
from my code, the idea doesn't sound very attractive.
> After all, I'd really love to set up another contest with
> different measures and criteria.
Go on! I don't think that "shortest code" is a very pythonic goal if you
count in bytes. The same contest with the length of the code measured in
"pythonic units" would be better. When I say "pythonic unit", I mean
to count 1 unit for each variable, literal, operator or key-word. That
would be more pythonic.
...but maybe less challenging. To try to do with Python things it wasn't
meant to do is more "fun" for a contest. ;-)
--
==================
Remi Villatel
maxilys_ at _tele2.fr
==================
More information about the Python-list
mailing list