With or Using

Steven D. Majewski sdm7g at Virginia.EDU
Fri Apr 20 14:04:19 EDT 2001


This was discussed and argued in an earlier thread.

The problem with 'with' is when it's nested ( think: "with pitcher...
with water... with spoon..." ) the implied pronoun is imprecise 
to a human reader -- you have to go back and look at the structures
definitions to see which slots belong to which records. 

It's not a problem for the compiler, which keeps handy lookup
tables, and it may not be a problem for the author who knows what
he meant, but for other readers it's a pain. 

In Pascal programs with 3 nested levels of 'with', I ususally have 
to resort to annotating the missing parent names back in as comments. 

It wouldn't be so bad if you weren't allowd to nest it, but than 
somebody would complain about the no-nesting restriction. Better
just to avoid it. 

BTW: My favorite ambiguous pronoun reference was from the Three Stooges: 

[ Curly holding a sledge hammer; Moe holding a spike or chisel: ] 

Moe: "When I nod my head, hit it!"
( You can guess what happens. :-) 

-- Steve Majewski



On Fri, 20 Apr 2001, Gary Walker wrote:

> Consider this:
> 
> Recipe for Lemonade
> 
> Add 8 cups water to a large pitcher
> Add 1/2 cup lemon juice to a large pitcher
> Add 2 cups sugar to a large pitcher
> Stir the ingredients that are in the large pitcher
> 
> Now consider:
> 
> To a large pitcher add:
>     8 cups water
>     1/2 cup lemon juice
>     2 cups sugar
>     and stir.
> 
> Did the second one confuse you? Did you forget the large pitcher?? Of course
> not. It's much easier to understand. So it is with with.





More information about the Python-list mailing list