27
Refactoring as a Boy Scout by Jesús Navarrete (@jenaiz) (HRS Holidays - Tech Talk)

Refactoring as a Boy Scout

  • Upload
    jenaiz

  • View
    139

  • Download
    2

Embed Size (px)

Citation preview

Refactoring as a Boy Scoutby Jesús Navarrete (@jenaiz)

(HRS Holidays - Tech Talk)

What is the problem?

new features ,, fix bugs ,, knowledge ,, humans

fast, fast, fast

Laziness is contagious

… vitality too!

What is technical debt?

–Actively Lazy blog http://blog.activelylazy.co.uk/tag/technical-debt/

“Technical debt is simply an inability to quickly make changes to an existing system”

… do we have options?

Big Bang

Dedicated Tasks

Boy Scouts

...what about Big Bang...

good

better quality of the code

fast new features

no new features in a while

big release

new bug fixes

bad

...what about Dedicated Tasks...

good

50% new features / 50% code improvement

collisions between teams

bad/good code at the same time

bad

...the last one… The Boy Scout rule

Broken windows theory http://en.wikipedia.org/wiki/Broken_windows_theory

–Robert Stephenson Smyth Baden-Powell (the father of scouting)

“Try and leave this world a little better than you found it”

–Martin Fowler

“Leave your code better than you found it”

good

There is no big bang release

Continuously improvements

Need cooperation/respect between people

No big change in the code

No big impact

bad

… what you should do IMHO...

Remove commented code before commit

Remove unused code or unused objects, clean

Write a good commit message

Rename names difficult to understand

Define the right visibility for your methods

small

Reduce complexity within the scope of your task

Reuse functionality (DRY)

Test all the new features/bugs as much as you can

medium

Adapt yourself to the new requirements & Knowledge

Redesign part of your architecture

Do modularisation, reuse as much as you can

interesting

… sometimes is difficult to see that you have

problems...

Thx! Q?

References…• 97 Things Every Programmer Should Know, by “…”

• Clean Code, by “Uncle Bob”

• http://programmer.97things.oreilly.com/wiki/index.php/The_Boy_Scout_Rule

• http://en.wikipedia.org/wiki/Broken_windows_theory

• http://en.wikipedia.org/wiki/Technical_debt

• http://martinfowler.com/bliki/TechnicalDebt.html