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
0
3.2k
Legacy codes
What's legacy codes? What should we do with it?
Kuncara Adi Nugraha
April 01, 2016
Tweet
Share
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
68
Agile Retrospective
lagilaper
0
180
Culture Test
lagilaper
0
190
Introduction to Vagrant and Docker
lagilaper
0
97
Recap of Jordan DeaMattson TechTalk
lagilaper
0
360
Other Decks in Programming
See All in Programming
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
750
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
720
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.2k
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
110
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
370
Ruby x Terminal
a_matsuda
7
590
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
460
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
410
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
240
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
170
TipKitTips
ktcryomm
0
160
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
150
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
660
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
340
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Designing Powerful Visuals for Engaging Learning
tmiket
0
260
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Ruling the World: When Life Gets Gamed
codingconduct
0
160
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Building an army of robots
kneath
306
46k
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Fireside Chat
paigeccino
42
3.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
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!!