Please enable JavaScript.
Coggle requires JavaScript to display documents.
Clean Code (Naming Conventions (Reduce Disinformation (Include the word…
Clean Code
Naming Conventions
Reveal Intent
Reduce Disinformation
Include the word 'String' if type is not 'String'
Noise words (thisBag and Bag variables)
Classes named nouns
Methods named verbs
One Word Per Concept
Get, Retrieve, Acquire
Set, Make
Testing
Fast
Independent
Repeatable
Self-Validating
Timely
Class
Keep small
Single-Responsiblity
Cohesion
Every method should use most instance variables
Split into smaller classes if necessary
Open to Extension NOT Modification
Prefer Interfaces over concrete classes
Functions
Should be SMALL
Do one thing
One Step-down of abstraction per
Monadic
Event Handlers
Transformation
Do NOT pass in single boolean
Comments
Legal Comments
Acceptable
Explanation of return format
Explanation of intent
Clarification of API Functions
Warning of Consequences
Processing Intensive
TODO
Bad
Mumbling
Does not include driving stimuli
Does not include consequences
Redundant
Closing Braces
Grouping Functions
In-Code Logs
Error Handling
Exceptions not Error Codes
Don't pass NULL
Group expected exceptions into an Exception class
Formatting
Vertical
Density implies association
Space separates ideass
High-Level First
Detail increases downwardd
Horizontal
Spacing to accentuate precedence
System Structure
Separate Object Creation from Use
Objects should not instantiate dependencies