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
Ahmed Omran
July 10, 2015
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Working With Legacy Rails Apps
Ahmed Omran
July 10, 2015
More Decks by Ahmed Omran
See All by Ahmed Omran
Compose Software Like Nature Would - RubyConf 2024
this_ahmed
0
91
Sane User Interfaces for Ruby on Rails
this_ahmed
2
180
Compose Software Like Nature Would
this_ahmed
1
230
Welcome to JavaScript
this_ahmed
0
55
Designing & Building RESTful JSON APIs
this_ahmed
4
5.4k
Other Decks in Programming
See All in Programming
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
500
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
160
Claspは野良GASの夢をみるか
takter00
0
180
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
5.3k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
2
530
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
230
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
240
AI時代のUIはどこへ行く?その2!
yusukebe
21
7k
Agentic UI
manfredsteyer
PRO
0
130
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.6k
AIで効率化できた業務・日常
ochtum
0
120
Featured
See All Featured
Are puppies a ranking factor?
jonoalderson
1
3.5k
A Tale of Four Properties
chriscoyier
163
24k
Docker and Python
trallard
47
3.9k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
830
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
580
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
We Are The Robots
honzajavorek
0
240
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
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