Meego Wiki
Views

Quality/TestSuite/MCTS/Code style common rule

From MeeGo wiki
< Quality | TestSuite | MCTS
Revision as of 08:37, 3 August 2010 by Xzheng (Talk | contribs)
Jump to: navigation, search

Code style common rule

  • The most important thing about coding style is to keep your source consistent.
  • Add head comments. Follow information is needed:
    • License
    • Brief description
    • Author
    • Version
  • Tab/blank space indention: Using once method and keep consistent for the component
    • 4 spaces
      • Add “set expandtab tabstop=4 shiftwidth=4” to your .vimrc
      • Use “:%retab” in cmd mode to replace all existing Tabs
    • one tab
  • Write comments appropriately
  • Separate code line if …
  • Deal with “()” and “{}” correctly
  • Naming, naming …
  • Pre-release test
Personal tools