Clean Code and Coding Standards
Meaningful Names (Open Discussion)
• Avoid Disinformation • Make Meaningful Distinctions • Use Pronounceable Names • Use Searchable Names • Member Prefixes (Avoid encodings) • Hungarian Notation (Avoid encodings) • Avoid Mental Mapping • Class and Method Names• Pick One Word per Concept
Functions (Open Discussion)
• Small functions• Do One Thing • One Level of Abstraction per Function • Reading Code from Top to Bottom • Use Descriptive Names • Function Arguments • Don’t Repeat Yourself (DRY) • Structured Programming • Indentation
Comments (Open Discussion)
• Comments Do Not Make Up for Bad Code // don’t comment bad code, rewrite it! • Explain Yourself in Code • Legal Comments • Informative Comments • Explanation of Intent • Clarification • Warning of Consequences • TODO Comments • Bad comments examples (/* The ****** variable */)
Formatting (Open Discussion)
• Team Rules: every programmer has his own favorite formatting rules but if he works in a team then the team rules.• Single template and color scheme for whole team.
Error Handling (Open Discussion)
• Prefer Exceptions to Returning Error Codes • Extract Try/Catch Blocks • Don’t Return Null
Coding Standards• Java: http://
www.oracle.com/technetwork/java/codeconvtoc-136057.html• PHP http://www.php-fig.org/psr/psr-2/• C# https://msdn.microsoft.com/en-us/library/ff926074.aspx• Android https://source.android.com/source/code-style.html• Objective C https://github.com/raywenderlich/objective-c-style-guide• Swift https://github.com/raywenderlich/swift-style-guide• AngularJS https://
google.github.io/styleguide/angularjs-google-style.html