[Newbies] names for boolean keyword arguments

Norbert Hartl norbert at hartl.name
Fri Sep 26 23:21:58 UTC 2008


On Fri, 2008-09-26 at 17:02 -0500, Mark Volkmann wrote:
> Is there a convention for naming keywork arguments that should have a  
> boolean value?
> 
> When it's not a boolean, it seems the convention is
> 
> value: aValue
> 
> That doesn't seem right for booleans though. I'd end up with arguments  
> like
> 
> expensive: anExpensive
> 
There is no strict rule to it but I think here the majority
follows some "hint what to expect" rule. That means you name
the argument after the class of the argument.

expensive: anExpensive

you would write if the argument is an object with class Expensive.
If it is a boolean you can write

expensive: aBoolean

Norbert





More information about the Beginners mailing list