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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
74
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
TipKitTips
ktcryomm
0
160
CSC307 Lecture 13
javiergs
PRO
0
310
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
180
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
210
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
140
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
230
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
250
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.3k
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
140
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
750
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
120
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
515
110k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
240
Darren the Foodie - Storyboard
khoart
PRO
3
2.8k
Fireside Chat
paigeccino
42
3.8k
The Curse of the Amulet
leimatthew05
1
9.7k
Chasing Engaging Ingredients in Design
codingconduct
0
130
The Pragmatic Product Professional
lauravandoore
37
7.2k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
250
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Designing for humans not robots
tammielis
254
26k
Evolving SEO for Evolving Search Engines
ryanjones
0
150
SEO for Brand Visibility & Recognition
aleyda
0
4.3k
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