Re: python coding contest



On Sun, 25 Dec 2005 19:14:43 -0500, rbt wrote:

> Steven D'Aprano wrote:
>> On Sun, 25 Dec 2005 18:05:37 +0100, 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.
>>
>>
>> What is your algorithm for determining "shortest" program? Are you
>> counting tokens, lines or characters? Does whitespace count?
>>
>>
> If whitespace and var names count, these things are going to be ugly :)

Yes, but the question is, is two lines and 347 characters ugly enough to
win?



--
Steven.

.



Relevant Pages

  • Re: Python syntax in Lisp and Scheme
    ... It's pretty obvious I made a typo. ... For someone who hasn't actually used Python, ... anywhere, whether comments affect indentation, etc. ... > But the whitespace already has all the structural information needed. ...
    (comp.lang.lisp)
  • Re: Structure using whitespace vs logical whitespace
    ... Where the dashes are indentation (since some newsgroup handlers don't do ... I'm using indentation to show logical flow through code. ... Python's choice to give semantic meaning to whitespace prevents me from ... I've been using python for a few years, and gotten around this in one ...
    (comp.lang.python)
  • Re: Not a flame war--curious about Python vs. Tcl
    ... One aspect of Python that I've that has always repelled me from it is ... the idea of using whitespace indentation to define loops and nested ... that code that used tabs to indent might not run correctly after ... string and list expansion that Tcl has. ...
    (comp.lang.tcl)
  • Re: Would Anonymous Functions Help in Learning Programming/Python?
    ... syntax without taking it on faith. ... There is nothing functionally lacking in Python. ... if you WERE to implement function definitions as normal ... Not to mention currently, inside groupings, whitespace is ...
    (comp.lang.python)
  • Re: Python statements not forcing whitespace is messy?
    ... having whitespace around everything is pretty different. ... The Python philosophy is to be permissive, ... Python enforces proper indentation which I think is a great idea since ...
    (comp.lang.python)