-
Notifications
You must be signed in to change notification settings - Fork 1
Clean Code Guideline
rdunker edited this page Aug 4, 2021
·
6 revisions
In order to archive a consistent code style we follow these general rules:
- Choose descriptive names
- Capitalize class names, global variables, pool dictionaries, and class variables
- Use Camel-Case
- Parameter-Names should start with a or an a (e.g. aMNMusicObject) - we let this unchanged in legacy code
- Parameter-Names should be descriptive (e.g. not anObject) - we let this unchanged in legacy code
- Do not use "magic numbers" in an expression
- No blank line after the method name (because it was handled like this in the legacy code)
- Insert a dot at the end of a statement, unless it is a return statement
- Leave one blank before a left parenthesis and after a right parenthesis
- Leave one blank after but not before a comma, a semicolon, and a colon in a selector
- Use Cascades whenever possible
- Only use parenthesis if necessary
- Only set and read instance variables by accessor methods