Top Banner
OLD CODE, NEW TRICKS OR, HOW I LEARNED TO LOVE LEGACY CODE AND YOU CAN, TOO. By M. Scott Ford Founder, Corgibytes @mscottford
44
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: Old Code, New Tricks

OLD CODE, NEW TRICKSOR, HOW I LEARNED TO LOVE LEGACY CODE AND YOU CAN, TOO.

By M. Scott Ford Founder, Corgibytes @mscottford

Page 2: Old Code, New Tricks

@mscottford

WHY WAS THIS MY FAVORITE PROJECT?

Page 3: Old Code, New Tricks

@mscottford

DISSATISFIED?WHY WAS I SO

• Product vs. Services?

• Desktop vs. Web?

• Startup vs. Enterprise?

• Hacker vs. Craftsman?

• Self Employed?

Page 4: Old Code, New Tricks

@mscottford

PRODUCT LIFE CYCLE

INTRODUCTION

GROWTH

MATURITY

DEVELOPMENT

Page 5: Old Code, New Tricks

@mscottford

PRODUCT LIFE CYCLE

INTRODUCTION

GROWTH

MATURITY

DEVELOPMENT

OBSCURITY

DECLINE

Page 6: Old Code, New Tricks

@mscottford

PRODUCT LIFE CYCLE

INTRODUCTION

GROWTH

MATURITY

DEVELOPMENT

OBSCURITY

DECLINE

MAKING

Page 7: Old Code, New Tricks

@mscottford

PRODUCT LIFE CYCLE

INTRODUCTION

GROWTH

MATURITY

DEVELOPMENT

OBSCURITY

DECLINE

MAKING

????

Page 8: Old Code, New Tricks

@mscottford

PRODUCT LIFE CYCLE

INTRODUCTION

GROWTH

MATURITY

DEVELOPMENT

OBSCURITY

DECLINE

MAKING

MENDING

Page 9: Old Code, New Tricks

MAKERS VS MENDERS

@mscottford

Page 10: Old Code, New Tricks

@mscottford

MAKERS• Speed to Market

• Rapid Prototyping

• Minimum Viable Product

• Likes Experimenting

• Energized by Big Launch

Page 11: Old Code, New Tricks

@mscottford

MENDERS• Repair Technical Debt

• Reduce Entropy

• Bug Fixes & Integrations

• Likes Stable & Steady

• Energized by Small Wins

Page 12: Old Code, New Tricks

@mscottford

DEVELOPER LANDSCAPE

HACKER CRAFTSMAN

Page 13: Old Code, New Tricks

@mscottford

DEVELOPER LANDSCAPE

HACKER CRAFTSMAN

MAKING

MENDING

Page 14: Old Code, New Tricks

@mscottford

DEVELOPER LANDSCAPE

HACKER CRAFTSMAN

RAPID PROTOTYPING

MAKING

MENDING

Page 15: Old Code, New Tricks

@mscottford

DEVELOPER LANDSCAPE

HACKER CRAFTSMAN

RAPID PROTOTYPING SOLID

MAKING

MENDING

Page 16: Old Code, New Tricks

@mscottford

DEVELOPER LANDSCAPE

HACKER CRAFTSMAN

RAPID PROTOTYPING SOLID

FIRE FIGHTING

MAKING

MENDING

Page 17: Old Code, New Tricks

@mscottford

DEVELOPER LANDSCAPE

HACKER CRAFTSMAN

RAPID PROTOTYPING SOLID

FIRE FIGHTING ????

MAKING

MENDING

Page 18: Old Code, New Tricks

@mscottford

DEVELOPER LANDSCAPE

HACKER CRAFTSMAN

RAPID PROTOTYPING SOLID

FIRE FIGHTING

SOFTWAREREMODELING

MAKING

MENDING

Page 19: Old Code, New Tricks

SOFTWARE REMODELING

@mscottford

Page 20: Old Code, New Tricks

SOFTWARE REMODELING

@mscottford

activities that reduce software entropy

Page 21: Old Code, New Tricks

@mscottford

SOFTWARE ENTROPY

Page 22: Old Code, New Tricks

@mscottford

Modification increases complexity, unless a conscious effort is made.

Using software means continuous modification.1

2Lehman,  M.  M.;  Belady,  L.A.  (1985),  Program  evolu=on:  processes  of  soCware  change,  Academic  Press  Professional,  Inc.,  San  Diego,  CA

SOFTWARE ENTROPY

Page 23: Old Code, New Tricks

@mscottford

The longer it’s been since the last time a

program has been modified, the more expensive it will be

to make the next modification.

Page 24: Old Code, New Tricks

BULLDOZE VS REMODEL

@mscottford

Page 25: Old Code, New Tricks

@mscottford

WHEN TO REMODEL?

Page 26: Old Code, New Tricks

@mscottford

WHEN TO REMODEL?

FEATURES YOU HAVE

Page 27: Old Code, New Tricks

@mscottford

WHEN TO REMODEL?

FEATURES YOU HAVE

FEATURES YOU NEED

Page 28: Old Code, New Tricks

@mscottford

WHEN TO REMODEL?

FEATURES YOU HAVE

FEATURES YOU NEED

REMODELINGJUSTIFICATION

Page 29: Old Code, New Tricks

@mscottford

REMODELING PRINCIPLES

Page 30: Old Code, New Tricks

@mscottford

REMODELING PRINCIPLES

Language Matters

Page 31: Old Code, New Tricks

project?

How do you describe a

LEGACY

@mscottford

Page 32: Old Code, New Tricks

@mscottford

WHAT COLOR IS YOUR FIELD?

Page 33: Old Code, New Tricks

• Talking positively about our work helps us feel good about it. • Consider the following:

@mscottford

LANGUAGE MATTERS

NEGATIVE POSITIVE

Legacy Brownfield

Rescue Spaghetti Code

Antiquated

Existing Code Restore Remodel

Revitalize Vintage/Classic

Page 34: Old Code, New Tricks

• Some terms used by the Agile community begin to break down when talking about existing projects. • Consider the following: – Sprint vs. Iteration – Estimate vs. Forecast

@mscottford

LANGUAGE MATTERS

Page 35: Old Code, New Tricks

@mscottford

Modern Techniques

REMODELING PRINCIPLES

Language Matters

Page 36: Old Code, New Tricks

• Would a doctor treat you using only medical knowledge available in the year you were born? • When working on an old house, would you limit yourself to only

tools available the year it was built? • You DO NOT have to limit yourself to old tools and techniques.

@mscottford

USE MODERN TECHNIQUES

Page 37: Old Code, New Tricks

@mscottford

Modern Techniques

REMODELING PRINCIPLES

Language Matters

RespectThe Past

Page 38: Old Code, New Tricks

• Look at work as a form of software archaeology. • Practice giving and receiving critiques. • Retrospective Prime Directive becomes invaluable. Reserve

judgement.

“Regardless of what we discover, we understand and truly believe that everyone did the best job they could, given what they knew at the time, their skills and abilities, the resources available, and the situation at hand.”

@mscottford

RESPECT THE PAST

Page 39: Old Code, New Tricks

• How to give a good critique: –Critique the code: never the author. –Call attention to the good things,

as well as opportunities for improvement. –Make it clear that you are stating opinion and not fact. • Practice at http://exercism.io • git blame

@mscottford

RESPECT THE PAST

Page 40: Old Code, New Tricks

@mscottford

Modern Techniques

Systems, Not Goals

REMODELING PRINCIPLES

Language Matters

RespectThe Past

Page 41: Old Code, New Tricks

• Goals work great for initial launch, not so well for maintenance. – Ex: Better to establish system where tests are added with

every commit than set a “goal” of 100% test coverage. – Continuous Integration – Continuous Deployment – Automated Code Review

@mscottford

SYSTEMS, NOT GOALS

Page 42: Old Code, New Tricks

• Some of our favorite tools for creating maintenance systems: – Style Cops (rubocop, FxCop) – Linters (jslint, csslint, xmllint) – Quality (Code Climate, BitHound) – Continuous Monitoring (Honeybadger, Airbrake, New Relic) – Continuous Deployment & Integration (CodeShip, Jenkins,

Travis CI, Circle CI) – Chat-Ops (Slack, Gitter, HipChat) @mscottford

SYSTEMS, NOT GOALS

Page 43: Old Code, New Tricks

QUESTIONS?

@mscottford

Page 44: Old Code, New Tricks

@mscottford

Contact Info@mscottford

corgibytes.com