Code Cleanliness
and
Business Impact
(30mins)
There really is a problem
and
here's how bad it is
We all agree that this stuff is important
But how important?
Sorry for the interruption
Code that Interrupts
When you hit Careless Code
you hit a Diversion
BUT the meter is running
CME Group pays while we follow that diversion
What’s the return on investment?
New knowledge?
Sort of...
“They're not code, they're not features, they are
puzzles”
a Tim Cooke rant
Puzzles Are Cheap + Easy to create
Cheap code up-front ==
Expensive maintenance + enhancement
So what?
Isn’t that what programming is?
Cumulative complexity
Production incident
So Why Do We Do It?
Functionally it works!
Coding at School
Reckless acts of heroics
Coding at School
vs
Coding at Work
Enterprise apps
have
non-functional
requirements
When non-functionals
go wrong
Usually
Later == Never
One more Broken Window
Feeling the pressure?
Are you making things better?
or
Are you making things worse?
Boy Scout Rule
"Check it in better than you found it"
What should Sideshow Bob do?
Put the rakes
away?Leave them?
Invest in the future?
or
Borrow from the future?
PMP Goal
"Learn all the quirks and nuances of
application codebase."
Winner: Most Unlikely PMP Goal Ever award
Build teams of
Software Engineers
not
Application Developers
Most important way to achieve
this is to Try
Don't be afraid of your code
Recognise that certain non-
functionals need investment
Integrate that investment into
normal day-to-day work
Clean Coding Practices
Future technical sessions planned
December training - "Clean Code" by Instil
Clean Code: Functions/Methods
Small
Do one thing, Do it well, Do it only
One level of abstraction per function
Don't Repeat Yourself / Remove Duplication
Clean Code: Comments
Explain yourself in code
Good/Bad/Redundant comments
"Don't comment bad code, rewrite it" - Brian Kernighan
Comments don't make up for bad code
Clean Code: Meaningful Names
Avoid disinformation
Make meaningful distinctions
Avoid mental mappings
Use intention revealing names