The Clean Coder
The Clean Coder
A Code of
Conduct for Professional Programmers
Author: Robert C Martin (Uncle Bob)
First
Rule: Do no harm
QA should
find nothing
Test, Test,
Test
Every Line
of Code should be tested!
Design your
solution to be easily tested
Best way is
to Write Tests first – i.e. TDD (Test Driven Development)
Merciless refactoring: Always check in a module cleaner than when
you checked it out.
Why do most
developers fear to make continuous changes to their code: They are afraid to break it. Why, they have no tests.
Work Ethic
Your Career is your responsibility
Woe to the Developer who entrusts his
careerto his employer
Professionals take time to work on their profession.
You should work 60 Hrs. per week
- 40 hrs for your employer
- 20 hrs. for you!
- You should be reading, practicing, learning, i.e. enhancing your career
- Do things to reinforce your passion
- Do things FUN!
Minimal List
every software professional should know
Design Patterns: know all 24 patterns
& working knowledge of them
Design Principles: kbow solid
principles and good understanding of those components
Methods: XP, Scrum, lean, Kanban,
waterfall, structured Analysis & Structured Design
Disciplines: TDD, Object-Oriented
Design, Structured Programming, CI & Pair Programming
Artifacts: UML, DFD, decision tables,
Flow Charts
Never
Forget:
Continuous Learning
Practice! i.e. Kata
Collaboration
Mentoring
Know your domain
Say “No”
Professionals speak the truth!
Have the courage to say no to managers
Professionals are expected to say No
What is Commitment?
You say you’ll do it
You mean it
You actually do it
False
Delivery
Saying you are done and knowing you
aren’t
Saying we are done enough and then
moving on to the next task
Carefully
partition the system into small understandable units that have little to do
with each other as possible.
Collaboration
is Critical!
Test Driven Development
(TDD )
Three laws
of TDD
- You are not allowed to write and procedure code until you have written a failing unit test
- You are not allowed to write more of a unit test than is sufficient to fail – and not compiling is failing
- You are not allowed to write more production code that is sufficient to pass the currently failing unit test
When Developers
lose the fear of cleaning, they Clean!
Clean code
is easier to read, easier to extend.
The Coding
DoJo
Kata: choreographed keystrokes and
mouse movements that simulates the solving of some programming problem.
Definition
of DONE
Professional developers: Done
means DONE!
Unit Tests:
Written by programmers
Acceptance
Tests: Written by Business for business
Single Responsibility
Principle (SRP)
Stand-up:
What did I do yesterday
What am I going to do today
What’s in my way
Priority
Inversion:
You convince yourself that something
else is more urgent and you do that instead.
This is called priority Inversion.
Professionals
realize that “quick and dirty” is an oxymoron.
Dirty always means slow!
We can avoid
pressure by keeping our systems, our code and our designs as clean as possible
Do not RUSH!
Pair when
the heat is On, Pair programming will help.
Get done faster with fewer defects.
Masters:
Know how to lead and coordinate multiple
teams. Proficient designers and
architects ad can code around everyone else.
Maintain technical role by reading,
studying, practicing, doing and teaching
Journeymen
Programmers are trained, competent and
energetic
Apprentices/Interns
Time of intense pair programming
Learn patterns, disciplines, TDD,
refactoring, etc..
Comments