Menu

Coding Guidelines

Stephan Roth

fas4ea Coding Guidelines

This wiki page contains some coding guidelines for the fas4ea project. Follow these guidelines unless you have an extremely good reason not to.

Clean Code

You should follow the principles and practices for good software design. Good software design means: well-designed, well-written and maintainable software as it is described in the book Clean Code: A Handbook of Agile Software Craftsmanship written by Robert C. Martin.

Always keep in mind:

  • It is more important to be correct than to be fast.
  • It is more important to be maintainable than to be fast.

Test-Driven Development

This is non-negotiable! There shall be no code without associated NUnit tests.

Refactoring

Refactoring should be part of your everyday business as a professional developer, so if there is a need to refactor: DO IT!

Check-in Policy

It is the goal that any current download from the source code control system is releasable. Therefore, it is incumbent upon you to insure that you run all the tests on code prior to check-in. Also, once the files are checked-in you should download the current files into a new folder, recompile it and run the tests. This verifies that what is in the source code control system is at least no worse than it was before you started.

Line Length

The line length for C# source code should be 100 columns. Only in some exceptional cases it is allowed to go beyond this point, e.g. if a method name gets very long, and it is not advisable to shorten it.

Naming

TODO

Comments

Use doc comments on all publicly accessible members. You should comment unusual algorithms and the reasoning behind some choices made, if they aren't obvious to readers.

Don't comment the obvious! Let the code be self-explanatory. Use expressive naming for methods, fields and variables.


Related

Home: Home
Wiki: Home

MongoDB Logo MongoDB