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
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
310
Metrics and Monitoring
lagilaper
0
79
Agile Retrospective
lagilaper
0
200
Culture Test
lagilaper
0
210
Introduction to Vagrant and Docker
lagilaper
0
100
Recap of Jordan DeaMattson TechTalk
lagilaper
0
370
Other Decks in Programming
See All in Programming
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
330
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
430
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
690
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.4k
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
190
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
170
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
220
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
800
RTSPクライアントを自作してみた話
simotin13
0
440
inferと仲良くなる10分間
ryokatsuse
1
360
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
270
OSもどきOS
arkw
0
400
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
860
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
190
Rails Girls Zürich Keynote
gr2m
96
14k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Evolving SEO for Evolving Search Engines
ryanjones
0
210
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Done Done
chrislema
186
16k
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!!