"Temporary" Variable

Steven D'Aprano steve at REMOVETHIScyber.com.au
Fri Feb 24 04:42:23 EST 2006


On Fri, 24 Feb 2006 00:24:25 +0000, Jeffrey Schwab wrote:

> Steven D'Aprano wrote:
>> On Thu, 23 Feb 2006 12:05:59 -0800, darthbob88 wrote:
>> 
>> My comments inserted inline.
>> 
>> 
>> 
>>>#!/usr/bin/python
>>>#simple guessing game, with numbers
>>>import random
>>>spam = random.randint(1, 100)
>> 
>> 
>> It is bad programming practice to give variables uninformative joke names.
> 
> Lighten up.  This isn't the middle of a 100-KLOC corporate monstrosity, 
> it's a 1/2-page usenet post.

The original poster is also a newbie who was having trouble with the
difference between strings and ints. If Guido called a variable spam,
I wouldn't presume to correct him. When Newbie McNew does it, it might
very well be because he doesn't know any better.

Just out of curiosity, when do you think is the right time to begin
teaching programmers good practice from bad? Before or after they've
learnt bad habits?



-- 
Steven.




More information about the Python-list mailing list