Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Confident refactors
Search
Mehdi Lahmam B.
June 19, 2017
Technology
160
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Confident refactors
Mehdi Lahmam B.
June 19, 2017
More Decks by Mehdi Lahmam B.
See All by Mehdi Lahmam B.
Beyond code: Becoming a Product Engineer
mehlah
0
75
Possible to measure developer productivity?
mehlah
0
76
PG FDW FTW
mehlah
0
200
Product culture
mehlah
0
110
OpenAPI and AsyncAPI specifications as contracts
mehlah
0
710
Technical Debt
mehlah
1
330
Data informed growth
mehlah
0
280
Serverless Ruby and AWS Lambda
mehlah
0
200
Middleware all the things
mehlah
2
900
Other Decks in Technology
See All in Technology
AIレビュー時代に必要なのは、SLOで引く撤退ライン
nobuoooo
0
150
指示待ちから変化に応じるClaude Codeへ!~環境からAgentへの帰り道を作る~
gotalab555
8
1.5k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
20k
PdMをやめて、 "プロダクトビルダー"という 働き方に変えました / PdM to Product Builder
shikichee
0
120
Claude Codeの体系的な理解と知識のフック
oikon48
8
6k
現場の暗黙知を継承するAIエージェント — 対話から生まれる長期記憶と Skills
atsukish
0
130
Claude Codeで開発以外の業務も爆速化しよう!
minorun365
PRO
11
9k
8bit CPU 2026
koba789
7
3k
Introduction to Bill One Development Engineer
sansan33
PRO
0
480
Microsoft MVP プログラムを紹介するから目指す人増えてくれ
tsubakimoto_s
0
140
[RSJ26] Flow as Flow: Modeling Robot Velocity Fields as Probability Velocity Fields
keio_smilab
PRO
0
110
AIエージェントのためのデータ設計
daiz21
0
520
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
810
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
220
Google's AI Overviews - The New Search
badams
0
1.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
310
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
The Limits of Empathy - UXLibs8
cassininazir
1
620
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
Transcript
Confident Refactors
Mehdi Lahmam @mehlah
25kV Rails app, started in Feb 2009 Never rewritten 23k+
commits from 52 contributors
Ruby is a massively successful language!
Early success Making it easy to make new things
Later success Making it easy to maintain old things
Today, let’s refactor some legacy code
Today, let’s refactor some legacy code
Refactor - verb To change the design of code without
changing its observable behavior.
Refactor - verb To change in advance of a new
feature or bug fix, making the job easier.
Today, let’s refactor some legacy code
Legacy - noun Old code.
Legacy - noun Code without tests.
Legacy - noun Code that we don’t like.
Legacy - noun Code we don’t understand well enough to
change confidently.
Today, let’s refactor some legacy code
Refactoring is hard
Refactoring legacy code is very hard
Easy to accidentally break functionality
Legacy refactors feels unsafe
Legacy refactors are hard to sell
Business priority Cost / risks
Business priority Cost / risks New features
Business priority Cost / risks New features Bugs fixes
Business priority Cost / risks New features Bugs fixes Testing
Business priority Cost / risks New features Bug fixes Testing
Refactoring
Business priority Cost / risks New features Bug fixes Testing
Refactoring no selling needed easy to sell can often sell very hard to sell
Selling refactoring is hard ⏲ ⛔
Business priority Cost / risks Refactoring
Too much pressure ⏳ ⚒
Refactors are scary
What techniques we have? PDD - Pray Driven Development Fowler’s
refactoring book Characterization testing A/B testing, experiments
Refactors as surgeries
Refactors as surgeries Requires careful planning Follow a clear process
Multiple observations Flexible tools Things can get bloody
1. Plan 2. Cut 3. Record 4. Validate 5. Refactor
6. Verify 7. Compare 8. Fallback 9. Delete Clear process
None
None
None
Cut
Record
Validate ✅
Refactor <Insert magic here />
Verify
Compare ⚖
Fallback
Delete ✂
We dit it
We dit it Time to celebrate hard