5. Clean Code – Environment
Build Requires One Step
Build time is manageable
Tests Execution Requires One Step
Always Use Source Control
Have Continuous Integration
7. Code Smell
A code smell is a hint that shows you
might have a problem in your system. '
www.mozaicworks.com
8. Coding Smells - Design
Misplaced Responsibility
Code at Wrong abstraction Level
Fields Define Temp Variables
Hidden Temporal Coupling
Over-engineering
Usage of Singleton / Statics / new
Interface Has Too Many Methods
9. Clean Code - Design
Be Precise
Don't Be Arbitrary
Keep Configuration at High Levels
Prefer Polymorphism Over conditionals
Prefer Composition Over Inheritance
S.O.L.I.D.
10. Coding Smells – Naming
There Are Several Naming Standards
More Names Mean The Same Concept
Someone Needs To Explain You The Code
11. Clean Code – Naming
Use Standards For The Language
Names Use Domain Language
Names Describe The Intention
Names Do Not Use Hungarian Notation
Names Do Not Contain Encodings
12. Coding Smells - Methods
Method Has More Than 3 Indents
Method Uses Getters From Other Classes
There Are Static Method
Methods & Ctors Have More Than 3 Args
Arguments Have out Or ref
13. Clean Code - Methods
Have Only One Responsibility
Use Only Internal State (No Feature Envy)
Avoid Static
Have Maximum Two Arguments
Do Not Pass Reference As Arguments
14. Coding Smells - Variables
You see a, i, bla, etc. As Variables
You see string, int, float, In Classes
There Are Static Variables In Classes
Use Integers for Currency
15. Clean Code - Variables
Use Explanatory Variables
Always Encapsulate Primitives
Avoid Statics
Use Appropriate Types
16. Clean Code - General
Boy Scout Rule
Keep It Simple, Stupid (KISS)
Delete Commented Code
Delete Unused Code
Minimize Duplication