Top Banner
Balancing Technical Debt and Clean Code @dave1010 Dave Hulbert
68
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Balancing Technical Debt and Clean Code

Balancing Technical Debtand Clean Code

@dave1010Dave Hulbert

Page 2: Balancing Technical Debt and Clean Code

@wearebase@phpdorset

@dave1010Dave Hulbert

Page 3: Balancing Technical Debt and Clean Code

istockphoto.com

Page 4: Balancing Technical Debt and Clean Code
Page 5: Balancing Technical Debt and Clean Code

tensionnot.com

Page 7: Balancing Technical Debt and Clean Code

Good things

● Delivering fast● Clean code

Page 8: Balancing Technical Debt and Clean Code

Bad things

● Technical debt● Delivering slow

Page 9: Balancing Technical Debt and Clean Code

Code of Conduct

Carry out your professional responsibilities with due care and diligence in accordance with the Relevant Authority’s requirements whilst exercising your professional judgement at all times

Page 10: Balancing Technical Debt and Clean Code
Page 11: Balancing Technical Debt and Clean Code

How to develop quickly

Page 12: Balancing Technical Debt and Clean Code

Developers● Skilled, Passionate, Healthy,

Focused, Disciplined● Conferences, user groups, meet ups● Read books, blogs, code● Write code, Open Source

contributions

Page 13: Balancing Technical Debt and Clean Code

Projects● Good requirements● Good specifications● Fast feedback

Page 14: Balancing Technical Debt and Clean Code

How to develop quickly

(in the short term)

Page 15: Balancing Technical Debt and Clean Code

● Less testing● Less planning● Less communication● Don't improve tools /

processes● Overtime● Outsource

Page 16: Balancing Technical Debt and Clean Code
Page 17: Balancing Technical Debt and Clean Code
Page 18: Balancing Technical Debt and Clean Code
Page 19: Balancing Technical Debt and Clean Code

Technical Debt

Page 20: Balancing Technical Debt and Clean Code

Shipping code before it's ready

Page 21: Balancing Technical Debt and Clean Code

Shipping code without enough

architecture

Page 22: Balancing Technical Debt and Clean Code

Visible InvisibleGoodBad

Page 23: Balancing Technical Debt and Clean Code

thetruthaboutcars.com

Page 24: Balancing Technical Debt and Clean Code

Visible InvisibleGood FeaturesBad

Page 25: Balancing Technical Debt and Clean Code

uberhumor.com

Page 26: Balancing Technical Debt and Clean Code

flickr.com/dangelophoto1

Page 27: Balancing Technical Debt and Clean Code

Visible InvisibleGood FeaturesBad Defects

Page 28: Balancing Technical Debt and Clean Code

wikimedia.org

Page 29: Balancing Technical Debt and Clean Code

Visible InvisibleGood Features ArchitectureBad Defects

Page 30: Balancing Technical Debt and Clean Code

amazon.com

Page 31: Balancing Technical Debt and Clean Code

mirror.co.uk

Page 32: Balancing Technical Debt and Clean Code

Visible InvisibleGood Features ArchitectureBad Defects Technical debt

Page 33: Balancing Technical Debt and Clean Code
Page 34: Balancing Technical Debt and Clean Code

Technical Debt

Page 36: Balancing Technical Debt and Clean Code

Good idea

● You think you'll be better off in the future

● The risk (interest) is manageable

Page 37: Balancing Technical Debt and Clean Code
Page 38: Balancing Technical Debt and Clean Code

Interest

● More user support needed● Manual tasks● Complete rewrite in future

Page 39: Balancing Technical Debt and Clean Code

Consequences● Less time on new features● Higher cost of new features● Harder to estimate new

features

Page 40: Balancing Technical Debt and Clean Code

bbc.co.uk

Page 41: Balancing Technical Debt and Clean Code
Page 42: Balancing Technical Debt and Clean Code

Complexity

Page 43: Balancing Technical Debt and Clean Code

Tests● Not comprehensive● Incorrect● Slow

Page 44: Balancing Technical Debt and Clean Code

We need to recognize that our job isn't about producing more code in less time, it's about creating software that is stable, performant, maintainable and understandable (to you or someone else, a few months or years down the road).

Matthew Gertner

Page 45: Balancing Technical Debt and Clean Code

Invest in architecture

Page 46: Balancing Technical Debt and Clean Code

Invest incode

Page 47: Balancing Technical Debt and Clean Code
Page 48: Balancing Technical Debt and Clean Code
Page 49: Balancing Technical Debt and Clean Code
Page 50: Balancing Technical Debt and Clean Code

TDD

● Run every bit of code that you write, ASAP

Page 51: Balancing Technical Debt and Clean Code

Write a test when you fix a bug

Page 52: Balancing Technical Debt and Clean Code
Page 53: Balancing Technical Debt and Clean Code

Domain-Driven Design

● Model the domain completely in classes that don't touch the UI, database or framework

Page 54: Balancing Technical Debt and Clean Code
Page 55: Balancing Technical Debt and Clean Code

How do you keep technical debt to a

minimum?

Page 56: Balancing Technical Debt and Clean Code

Refactoring

wikimedia.org

Page 57: Balancing Technical Debt and Clean Code

Refactoring● Restructuring without

changing behaviour● Makes it easier to read,

understand, test, change, add new features to

Page 58: Balancing Technical Debt and Clean Code
Page 59: Balancing Technical Debt and Clean Code

Refactoring● Inject dependencies● Eliminate dependencies● Create interfaces to type hint to● Extract functions● Rename● Reduce cyclomatic complexity● http://refactoring.com/catalog/

Page 60: Balancing Technical Debt and Clean Code

Estimating● Estimates for new features

need to include refactoring– (if you don't want to increase

technical debt)– Refactoring doesn't add perceived

value so it's hard to sell

Page 61: Balancing Technical Debt and Clean Code

Debt is expensive● Paying technical debt with

interest takes more time than continual refactoring

Page 62: Balancing Technical Debt and Clean Code

bonkersworld.net

Page 63: Balancing Technical Debt and Clean Code

Break the rules

Page 64: Balancing Technical Debt and Clean Code

● Help you deliver faster in the short term

● Long term strategy● Disposable prototype● Just don't need to write clean

code

Page 65: Balancing Technical Debt and Clean Code
Page 66: Balancing Technical Debt and Clean Code

Sprint vs MarathonSprint (example) Marathon (example)

Peripheral component (logs) Central component (DB)

Trivial (make a CSV) Complex (search algorithm)

Few consequences of bugs (game) Important (nuclear reactor)

Isolated (contact form) Reused (authentication)

Abandonable (migration script) Continued updates

One developer Big team

Time & money to pay technical debt later

Long term delivery

Page 67: Balancing Technical Debt and Clean Code

Investment in code is a balance

Page 68: Balancing Technical Debt and Clean Code

Thanks!

bitly.com/tech-debt-feedback

@dave1010

Dave Hulbert