Regarding coding style

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Mar 8 19:51:01 EST 2008


On Sat, 08 Mar 2008 13:40:56 -0800, dave_mikesell wrote:

> On Mar 8, 2:27 pm, castiro... at gmail.com wrote:
> 
>> Good comments are better than bad names. Good names are better than bad
>> comments.
> 
> If you're taking the time to write good comments, why not just fix the
> bad names?  The compiler/interpreter can never, ever catch bad comments.

Yes, but the Python compiler can only catch bad names if you do this at 
the top of every module:

import semantic_analysis
import magic.crystal_ball.read_programmers_mind

Unfortunately, this comes with a *serious* performance hit, so most 
people don't bother. Instead, they rely on the programmer to write good 
descriptive names AND good comments, because not everything can be 
documented in a name.



-- 
Steven



More information about the Python-list mailing list