What are Code Smells?
things in source code that indicate problems
not bugs but will make life harder later
Examples for code smells
duplicate code
dead code
commented code
long methods / classes / parameter lists
single letter variables
unnecessary inheritance
empty methods
What is the boyscout rule?
Leave the code base a little bit cleaner than when you started working on it
What is ward’s principle?
You know youre working on clean code when every routine turns out to be exactly what one expected
What are some of the properties of clean code?
Clearly communicates intent
embarrassingly simple
capsulated
is it elegant?
is it minimal?
is it easy to change?
What makes a Name good?
reveal intention
avoid disinformation / ambiguities
make meaningful distinctions
avoid encodings
of scope or type
the ide does that
Zuletzt geändertvor 3 Tagen