Recent Changes - Search:

Main.SideBar (edit)

PmWiki

CodingStyle

Until now we've not put any requirements on the coding style on the coder. But as the project grows more and more I am beginning to re-think my position on this. A unique coding style would make the code more readable (especially easier readable!) which is always a good thing.

But I still haven't decided whether I want to put coding style limitations on us, so we go on with our rules as usual:

  • When you edit an existing file, use the coding style that is used by that file.
  • If an exising file uses several different style, use the one that is used the most in the file (btw: we do not have any such files and I believe we will never have!)
  • If you begin a new file, you can use your own coding style. If possible use a style that is used in most boson files, but this is not a requirement (yet?)
  • If you rewrite an exising file, i.e. change nearly everything, then you are allowed to change the coding style to fit your own. But _only_ then! Do NOT change the coding style of an exising file if you do minor changes only!

Although I don't place a certain coding style on you, there are a few requirements that are _necessary_ in your coding style in boson. I consider not following these bugs, and will fix any occurance of it.

  • always use braces
don't use things like if (foo) bar(); instead use if (foo) { bar(); } , i.e. always use braces.
I consider missing braces a bug, because when you add debug code you often oversee the missing braces and then the code behaves different than expected.
  • use a member prefix "m" for member variables, e.g. "mUnits".
Edit - History - Print - Recent Changes - Search
Page last modified on January 11, 2005, at 17:55