KEMBAR78
Agileee Developers Toolkit In The Agile World | PDF
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 & Coach
Owner Mosaic Works

Founder and Coordinator of Romanian Agile
community, AgileWorks Romania
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
The fantastic journey
   of the beginner
     craftsman
Programming is fun
when you create great
  soft ware & write
    beautiful code
A minimal toolkit on
     the road
       Refactoring

 TDD    Clean Code   Emergent Design


           Pair
       Programming
Clean code? What’s
       that?
Clean variable names
         Meaningful names
     Intention revealing-names
No encodings (e.g. Hungarian notation)

     int d; //elapsed time in days
                   vs
        int elapsedTimeInDays
Clean functions
             Small !
Do one thing. And it’s DONE well.
       Descriptive names
        No sides effects
    No duplicated functions

  ComputeAndWriteResult()
            vs
     Write(Compute())
Clean code - error handling
      Try-Catch-Finally - written first
  Expected 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();
Refactoring

 23 + 23 + 23 + 23 + ... + 23
             or
        1000 * 23 ?

   Improve maintainability
        & readability
through changes in small steps
keeping the external behavior
Refactoring
     To write clean code, you must
first write dirty code and then clean it.

                      by Robert C. Martin
Refactoring - how to
     E.g. : Extract methods, class
             Move methods
Replace conditions with polymorphism
       Eliminate duplicate code
        Extract data structure
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
Use the toolkit for
building soft ware
  incrementally
How we learn useful
    practices?
Soft ware Craftsmanship
Learn & Practice!
        &
Practice & Learn!
Code Kata
Code retreat
 Coding 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.com
mddiaconu@gmail.com; t witter: fireladyM

         www.alexbolboaca.ro
 alexboly@gmail.com; t witter: alexboly


  AgileWorks Romania - agileworks.ro

Agileee Developers Toolkit In The Agile World

  • 1.
    Developers’ Toolkit in the Agile World by Maria Diaconu & Alexandru Bolboaca
  • 2.
    Code quality &indicators
  • 3.
    Bad code? We don’twrite bad code...
  • 4.
  • 5.
  • 6.
    Ups, we arealmost always under pressure
  • 7.
  • 8.
    My code isgood- enough. Why should I change it?
  • 9.
    About the storytellers 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 storytellers Alexandru Bolboaca Soft ware Developer Hands-on soft ware consultant@MosaicWorks Aspiring soft ware craftsman Active member of Romanian Agile community, AgileWorks Romania
  • 11.
    The fantastic journey of the beginner craftsman
  • 12.
    Programming is fun whenyou create great soft ware & write beautiful code
  • 13.
    A minimal toolkiton the road Refactoring TDD Clean Code Emergent Design Pair Programming
  • 14.
  • 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())
  • 18.
    Clean code -error handling Try-Catch-Finally - written first Expected 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();
  • 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 - howto E.g. : Extract methods, class Move methods Replace conditions with polymorphism Eliminate duplicate code Extract data structure
  • 22.
    The boy scoutrule It’s not enough to write the code well. The code has to be kept clean over time. by Robert C. Martin
  • 23.
    Use the toolkitfor building soft ware incrementally
  • 24.
    How we learnuseful practices?
  • 25.
  • 26.
    Learn & Practice! & Practice & Learn!
  • 27.
  • 28.
  • 29.
    Good code readslike a novel.
  • 30.
    Good code readslike a novel. Excellent code reads like haiku.
  • 31.
    ... and thisis not the end of the journey
  • 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