Guido's intuition (was Re: typetesting, adaptation, typeclasses, ...)

dman dsh8290 at rit.edu
Sat Feb 2 22:36:32 EST 2002


On Sun, Feb 03, 2002 at 01:40:12AM +0000, Tim Hammerquist wrote:
 
| BTW, less wasted v-space is one very attractive feature of Python.

Yes, but it still doesn't mean you should hide the braces (in the
inferior languages) on other lines.

| My eyes just can't parse:
| 
| if ( some_condition() ) {
|   {
|     for (i = first_i();i <= 10; i++)
|       {
|         initialize_some_stuff();
|         while ( some_other_condition() )
|           {
|             do_some_more_stuff()
|           }
|       }
|   }

I have trouble with that too.  My preference (FWIW, probably nothing) :

if ( some_condition() )
{
    for (i = first_i();i <= 10; i++)
    {
        initialize_some_stuff();
        while ( some_other_condition() )
        {
             do_some_more_stuff()
        }
    }
}


Notice how the matching braces are horizontally aligned and at the
same level as the line that initiates the bock?  If the braces are
removed, and colons added it will look like python (with some
extraneous parens).

| ...yet I have no trouble parsing
| 
| if ( &some_condition ) {
|     for $i (&first_i .. 10) {
|         &initialize_some_stuff;
|         &do_some_more_stuff while &some_other_condition;
|     }
| }

This is hard for me because I can't see what the '}' goes with.
Combine this with leaving out the braces on one-line compound
statements, and I'll have real problems.

-D

-- 

A perverse man stirs up dissension,
and a gossip separates close friends.
        Proverbs 16:28





More information about the Python-list mailing list