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
0
150
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
42
Sane User Interfaces for Ruby on Rails
this_ahmed
2
160
Compose Software Like Nature Would
this_ahmed
1
180
Welcome to JavaScript
this_ahmed
0
42
Designing & Building RESTful JSON APIs
this_ahmed
4
5.2k
Other Decks in Programming
See All in Programming
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
250
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1k
C++20 射影変換
faithandbrave
0
530
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
430
Java on Azure で LangGraph!
kohei3110
0
170
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
150
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
1
300
都市をデータで見るってこういうこと PLATEAU属性情報入門
nokonoko1203
1
570
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
130
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
390
WindowInsetsだってテストしたい
ryunen344
1
190
Featured
See All Featured
Building Adaptive Systems
keathley
43
2.6k
Gamification - CAS2011
davidbonilla
81
5.3k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
How GitHub (no longer) Works
holman
314
140k
Designing for humans not robots
tammielis
253
25k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.8k
Designing Experiences People Love
moore
142
24k
Statistics for Hackers
jakevdp
799
220k
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