8. My code is good-
enough. Why should I
change it?
9. About the story tellers
Maria Diaconu
Developer, Technical Lead, Manager
Agile/Scrum Practitioner & Coach
Owner Mosaic Works
Founder and Coordinator of Romanian Agile
community, AgileWorks Romania
10. About the story tellers
Alexandru Bolboaca
Soft ware Developer
Hands-on soft ware consultant@MosaicWorks
Aspiring soft ware craftsman
Active member of Romanian Agile community,
AgileWorks Romania
16. Clean variable names
Meaningful names
Intention revealing-names
No encodings (e.g. Hungarian notation)
int d; //elapsed time in days
vs
int elapsedTimeInDays
17. Clean functions
Small !
Do one thing. And it’s DONE well.
Descriptive names
No sides effects
No duplicated functions
ComputeAndWriteResult()
vs
Write(Compute())
19. Refactoring
23 + 23 + 23 + 23 + ... + 23
or
1000 * 23 ?
Improve maintainability
& readability
through changes in small steps
keeping the external behavior
20. Refactoring
To write clean code, you must
first write dirty code and then clean it.
by Robert C. Martin
21. Refactoring - how to
E.g. : Extract methods, class
Move methods
Replace conditions with polymorphism
Eliminate duplicate code
Extract data structure
22. The boy scout rule
It’s not enough to write the code well. The
code has to be kept clean over time.
by Robert C. Martin
32. Thank you!
Maria Diaconu & Alexandru Bolboaca
MosaicWorks - www.mozaicworks.com
mddiaconu@gmail.com; t witter: fireladyM
www.alexbolboaca.ro
alexboly@gmail.com; t witter: alexboly
AgileWorks Romania - agileworks.ro