View
1.026
Download
1
Category
Tags:
Preview:
DESCRIPTION
Slides from Maria Diaconu and Alexandru Balboaca talking at Agileee conference 2009, Ukraine
Citation preview
Developers’ Toolkit in the Agile World
by
Maria Diaconu & Alexandru Bolboaca
Code quality & indicators
Bad code? We don’t write bad
code...
...just occasionally
...when under pressure
Ups, we are almost always under pressure
Or
My code is good-enough. Why should I
change it?
About the story tellers
Maria Diaconu
Developer, Technical Lead, Manager Agile/Scrum Practitioner & CoachOwner Mosaic Works
Founder and Coordinator of Romanian Agile community, AgileWorks Romania
About the story tellersAlexandru Bolboaca
Software DeveloperHands-on software consultant@MosaicWorksAspiring software craftsman
Active member of Romanian Agile community, AgileWorks Romania
The fantastic journey of the beginner
craftsman
Programming is fun when you create great
software & write beautiful code
A minimal toolkit on the road
Clean Code
Pair Programming
Emergent DesignTDD
Refactoring
Clean code? What’s that?
Meaningful namesIntention revealing-names
No encodings (e.g. Hungarian notation)
int d; //elapsed time in daysvs
int elapsedTimeInDays
Clean variable names
Small !Do one thing. And it’s DONE well.
Descriptive namesNo sides effects
No duplicated functions
ComputeAndWriteResult()vs
Write(Compute())
Clean functions
Try-Catch-Finally - written firstExpected behavior covered first, exceptions
treated after Don’t return Null; Don’t Pass Null
try { MealExpenses expenses = expenseReportDAO.getMeals(employee.getID()); m_total += expenses.getTotal(); } catch(MealExpensesNotFound e) { m_total += getMealPerDiem(); }
vs
MealExpenses expenses = expenseReportDAO.getMeals(employee.getID()); m_total += expenses.getTotal();
Clean code - error handling
23 + 23 + 23 + 23 + ... + 23or
1000 * 23 ?
Improve maintainability& readability
through changes in small steps keeping the external behavior
Refactoring
RefactoringTo write clean code, you must
first write dirty code and then clean it.
by Robert C. Martin
Refactoring - how toE.g. : Extract methods, class
Move methodsReplace conditions with polymorphism
Eliminate duplicate code Extract data structure
The boy scout ruleIt’s not enough to write the code well. The
code has to be kept clean over time.
by Robert C. Martin
Use the toolkit for building software
incrementally
How we learn useful practices?
Software Craftsmanship
Learn & Practice!&
Practice & Learn!
Code KataCode retreatCoding Dojo
Aspiring craftsmen
@AgileWorks -CodeRetreat/Dojo Bucharest - June
Good code reads like a novel.
Good code reads like a novel.
Excellent code reads like haiku.
... and this is not the end of the journey
Thank you!Maria Diaconu & Alexandru Bolboaca
MosaicWorks - www.mozaicworks.commddiaconu@gmail.com; twitter: fireladyM
www.alexbolboaca.roalexboly@gmail.com; twitter: alexboly
AgileWorks Romania - agileworks.ro
Recommended