diff --git a/docs/codestyle.txt b/docs/codestyle.txt new file mode 100644 index 0000000..dbcb42d --- /dev/null +++ b/docs/codestyle.txt @@ -0,0 +1,23 @@ +Zombie:Reloaded Code Guidelines +=============================== + +This is a draft of coding guidelines for Zombie:Reloaded. If something is not +mentioned here, study the existing code to ensure consistency. + +Most of the code was written before we decided on the code style, so we may even +break our own rules according to this document. + +Highly recommended book: +Clean Code: A Handbook of Agile Software Craftsmanship (2008) +Robert C. Martin + +* Curly braces on separate lines. +* Indent with 4 spaces instead of tabs (configure your editor). +* Unix line endings. +* Always use curly braces with control statements (if, for, while, do). +* UTF-8 file encoding without BOM. +* Extract code into multiple functions if code is too complex. ZR is still bad + at following this rule. +* If the code needs comments, it should be refactored/renamed to better explain + what it's doing. ZR has a lot of unnecessary comments, mostly because it's not + following the single purpose-function rule above.