Changes between Version 1 and Version 2 of CodingStandards


Ignore:
Timestamp:
Jul 16, 2009, 7:15:03 PM (10 years ago)
Author:
flip
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodingStandards

    v1 v2  
    106106you considered the reader when you wrote it.
    107107
    108 }}}
    109 
    110108In General
    111109----------
     
    132130  about undeclared variables whereas Python will happily accept something like
    133131  this:
    134   ::
     132}}}
     133
     134{{{
     135#!python
    135136   
    136137    # Code added by person A
     
    143144        mdsc = None
    144145
    145 
     146}}}
     147
     148{{{
     149#!rst
    146150  There's also the benefit that longer variable names help to document the code.
    147151  The name `mdesc` could mean "mule desecration" for all I know, whereas
     
    167171
    168172  This works:
    169   ::
    170  
     173}}}
     174
     175{{{
     176#!python 
    171177     z = something * PI - something_else / FUDGE_FACTOR
    172  
     178}}}
    173179  This works and is easier to read:
    174   ::
     180{{{
     181#!python 
    175182 
    176183     z = (something * PI) - (something_else / FUDGE_FACTOR)
    177 
    178   .. 
     184}}}
     185
    179186
    180187- Don't put redundant information in names. For instance, in a Person class it