Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Working With Legacy Rails Apps
Search
Ahmed Omran
July 10, 2015
Programming
180
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
Transcript
38 slides
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
More Decks by Ahmed Omran
See All by Ahmed Omran
Compose Software Like Nature Would - RubyConf 2024
this_ahmed
0
120
Sane User Interfaces for Ruby on Rails
this_ahmed
2
190
Compose Software Like Nature Would
this_ahmed
1
250
Welcome to JavaScript
this_ahmed
0
58
Designing & Building RESTful JSON APIs
this_ahmed
4
5.4k
Other Decks in Programming
See All in Programming
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
180
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
140
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
640
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
17
9.5k
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
190
Snowflake Openflow Connector利用の勘所 / 20261024developersio2026tokyo-snowflake-openflow
kasacchiful
PRO
0
360
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
350
Kotlin Fest 2026: Kotlin コンパイラに Contribute してみよう! - Kotlin/Wasm で深い再帰を書けるようにした話
ternbusty
1
400
小さなアプリを作って公開するまで
onozaty
0
220
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
240
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
780
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.2k
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
630
Raft: Consensus for Rubyists
vanstee
143
7.9k
How GitHub (no longer) Works
holman
316
150k
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
610
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
530
Music & Morning Musume
bryan
48
7.5k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
470
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
Joys of Absence: A Defence of Solitary Play
codingconduct
1
580
How to build a perfect <img>
jonoalderson
1
6.2k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k