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
Legacy codes
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kuncara Adi Nugraha
April 01, 2016
Programming
3.2k
0
Share
Legacy codes
What's legacy codes? What should we do with it?
Kuncara Adi Nugraha
April 01, 2016
More Decks by Kuncara Adi Nugraha
See All by Kuncara Adi Nugraha
Recap of Dicoding Events : Continuous Quality and Test Automations
lagilaper
0
300
Metrics and Monitoring
lagilaper
0
69
Agile Retrospective
lagilaper
0
180
Culture Test
lagilaper
0
200
Introduction to Vagrant and Docker
lagilaper
0
99
Recap of Jordan DeaMattson TechTalk
lagilaper
0
370
Other Decks in Programming
See All in Programming
Codex CLI でつくる、Issue から merge までの開発フロー
amata1219
0
270
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.5k
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
470
飯MCP
yusukebe
0
440
おれのAgentic Coding 2026/03
tsukasagr
1
120
Nuxt Server Components
wattanx
0
230
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
280
AI活用のコスパを最大化する方法
ochtum
0
360
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
140
OTP を自動で入力する裏技
megabitsenmzq
0
130
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
180
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
530
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Typedesign – Prime Four
hannesfritz
42
3k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
350
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
180
Joys of Absence: A Defence of Solitary Play
codingconduct
1
330
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
160
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
First, design no harm
axbom
PRO
2
1.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
240
YesSQL, Process and Tooling at Scale
rocio
174
15k
Transcript
Legacy Code Sleman, April 1st, 2016
What is legacy code? Code we’ve gotten from somewhere else
Demoralising code (big ball of mud) Code without unit tests
None
Characteristics Poor Architectures Without tests Poor written documentation Oral documentation
IT’S WORKING!!!
IF IT’S WORKING, THEN WHY CHANGE IT ???
Reasons to change Legacy Code Kill some BUGS! Add new
FEATURES Do some OPTIMISATIONS Add new automations things ( tests, scaling, etc)
None
Reasons not to change Legacy Code It looks ugly I
would like to see nicer code I want to use new shiny tools ….
What do we do? REWRITE?
BOOOOMMMM!!!
STOP!! DON’T REWRITE It takes time Need business analysis Features
will keep coming Breeding new bugs
Working Code is OK
What do we do? You can rewrite but you cannot
rewrite all Fight temptations to refactor a lot of codes DO IT SLOWLY AND CALMLY!!
2 Kinds of Refactoring Edit and Pray Cover and Modify
Edit and Pray Steps Find boundaries Discover the codes Refactor
/ Rewrite Run it and do smoke tests Pray that everything is okay
Cover and Modify Steps Find boundaries Discover the code Start
write tests around the to-be- refactored code Do refactor / rewrite Tests and ensure its working
Find Boundaries Act at one part of code at a
time Domains FTW
Discover the Code Read documentations Interview previous developers Read the
codes Try the codes
Prepare and Write Tests Surround it with tests ( integration,
GUI, unit tests, exploratory tests ) Testing is an investment
Write Code to make it Pass! SELF EXPLANATORY! ^_^
THANKS!!