Differences between revisions 5 and 6
Revision 5 as of 2008-05-09 13:52:39
Size: 1099
Editor: abuehl
Comment: removing spaces from page name
Revision 6 as of 2009-01-25 12:07:54
Size: 1100
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
 * don't name functions or classes with Uppercase, CamelCase or lots_of_under_bars  * don't name functions or classes with Uppercase, !CamelCase or lots_of_under_bars

Don'ts:

  • don't use tabs
  • don't use lines longer than 80 characters
  • don't leave trailing whitespace
  • don't name functions or classes with Uppercase, CamelCase or lots_of_under_bars

  • don't make helper functions prefixed with do_
  • in general, don't make ["mpm"] use his shift key any more than he has to
  • don't use default arguments without a good reason
  • don't use a class unless it makes your code smaller and easier to read
  • don't use set(), sorted(), rsplit(), or various other post-Py2.3 goodies
  • don't use Unicode strings unless you really grok Mercurial's charset philosophy

  • don't put OS-specific hacks outside of util.py and friends.

Do:

  • use single quotes rather than double quotes
  • use a single underscore prefix for private methods and functions
  • use a single underscore prefix for a helper function
  • add a linebreak after a colon
  • add docstrings
  • use _() to mark things for i18n
  • add testcases to the test suite
  • run the test suite

-- ["mpm"]


CategoryContributing

CodingStyle (last edited 2022-02-21 17:44:01 by RaphaelGomes)