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
Working With Legacy Rails Apps
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ahmed Omran
July 10, 2015
Programming
0
160
Working With Legacy Rails Apps
Ahmed Omran
July 10, 2015
Tweet
Share
More Decks by Ahmed Omran
See All by Ahmed Omran
Compose Software Like Nature Would - RubyConf 2024
this_ahmed
0
77
Sane User Interfaces for Ruby on Rails
this_ahmed
2
180
Compose Software Like Nature Would
this_ahmed
1
220
Welcome to JavaScript
this_ahmed
0
50
Designing & Building RESTful JSON APIs
this_ahmed
4
5.3k
Other Decks in Programming
See All in Programming
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
170
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
170
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
230
Claude Code Skill入門
mayahoney
0
440
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
190
Understanding Apache Lucene - More than just full-text search
spinscale
0
140
へんな働き方
yusukebe
6
2.8k
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
250
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
150
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
110
Claude Codeログ基盤の構築
giginet
PRO
7
3.7k
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
290
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
690
Utilizing Notion as your number one productivity tool
mfonobong
4
270
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
340
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
Transcript
Working With Legacy Rails Apps @this_ahmed
Working With Legacy Rails Apps @this_ahmed
legacy code • untested code (Michael C. Feathers) • code
someone else wrote (old gems, outsourcing, maintainers left) • difficult to work with • risky to change • but serves a useful function
googling legacy code …
every project has legacy code?
None
• learning & experimenting • ambitious applications • big project,
developer churn, hiring outside help • bad code … even with the best of intentions • “Technical debt”
None
–Robert C. Martin “Even the most disciplined development team, knowing
the best principles, using the best patterns, and following the best practices will create messes from time to time.”
in the face of legacy code you can …
None
or…
None
Useful techniques
Rebuild Refactor
–Robert C. Martin “…taking a tangled, opaque, convoluted system and
slowly, gradually, piece by piece, step by step, turning it into a simple, nicely structured, well-designed system.”
Boy Scout Rule Clean up around you work area. Small
fixes; small refractors.
cover and modify • add unit test • test passes
• modify code • test passes
use mock objects to break dependencies
None
mock dependencies
break complicated dependencies with seams
None
seam => put in method + stub
first step to later refactor
i don’t understand this code…
Ask someone
code archeology
code archeology git blame / Github
code archeology search code for context git blame / Github
code archeology project management ticket git blame / Github search
code for context
code archeology git blame / Github project management ticket commit
message search code for context
review • boy scout rule • cover and modify •
break dependencies with mocks and seams • understand code with archeology
some parting thoughts
unit test
None
None
• code review • small git branches • add lots
of context in pull request / commit message