How coding in Python is bad for you

Chris Angelico rosuav at gmail.com
Tue Jan 24 00:16:43 EST 2017


On Tue, Jan 24, 2017 at 4:00 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Tuesday 24 January 2017 15:41, Chris Angelico wrote:
>
>> Remember: If you have only one clock, it might be right and it might
>> be wrong, but it's consistent. If you have two clocks and they
>> disagree, you have no clue what the time is.
>
> During the golden age of sail, there was a saying, never go to sea with two
> chronometers. Take one, or three, but never two.
>
> Obviously the lesson here is that programming languages should have *three*
> ways of setting out the structure:
>
>     if condition:
>         {
>           BEGIN
>             code goes here
>           }
>         END
>

No no no. You have two orthogonal styles (indentation and tokens), but
then you added another of the same style (another pair of tokens). You
need a third orthogonal style. I suggest that each nesting level be
heralded by an increase in indentation, an open brace, and a new text
colour.

ChrisA



More information about the Python-list mailing list