[wplug] first language

bgtrio at yahoo.com bgtrio at yahoo.com
Tue Apr 1 15:06:19 EST 2003


On 1 Apr 2003 billings at negate.org wrote:

> On Tue, 2003-04-01 at 11:59, bgtrio at yahoo.com wrote:
> > Ooh, big scary whitespace.
> ...
> > I don't get why people have such a problem with whitespace as opposed to 
> > any other sytactic element.  It strongly encourages readability because 
> > the positioning of the text gives you a clue as to the meaning of clause- 
> > with nested brackets you sometimes have to do a lot of backtracking to 
> > figure out where you are.
> > 
> > Ok, don't want to start a holy war, just don't like to see the snake 
> > slandered :)
> > 
> > Bryguy
> > 
> 
> My problem has always been this: It's nearly impossible to spot
> whitespace "errors" (tab instead of spaces, for example).  

Well, the part of my post you snipped out pointed to a utility that checks 
that.  But just like you don't write your C code in Microsoft Word with 
autocorrect turned on, you don't write python code in an inappropriate 
environment.  You use an editor that uses spaces for tabs. 

> 
> And, in my opinion, I don't think it's the languages' role to enforce
> the visible structure of the code, because it's not always the case that
> a simple indentation rule will improve the readability of the code.  

This is like the argument that seatbelts make some car crashes worse- it's 
true anecdotally, but unless you're very short or something on average it 
makes things better. 

Languages enforce some sort of standards, but they use different syntactic 
elements to do it.  Lisp uses Lots of Irritating, Silly Parentheses, C 
uses brackets, Python uses whitespace.  Other languages ignore whitespace 
to allow people to pick their own indentation style.

But why do you use an indentation style?  To hint at the meaning of the 
text, the same way writers use whitespace to indicate various things, like 
paragraph beginnings and quoted selections.  Python just guarantees that 
anyone can understand these hints since they're a part of the language and 
therefore standardized.

Bryguy




More information about the wplug mailing list