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
0
3.1k
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
270
Metrics and Monitoring
lagilaper
0
54
Agile Retrospective
lagilaper
0
110
Culture Test
lagilaper
0
180
Introduction to Vagrant and Docker
lagilaper
0
86
Recap of Jordan DeaMattson TechTalk
lagilaper
0
320
Other Decks in Programming
See All in Programming
CircleCIを活用して AWSへの継続的デリバリーを 実践する
coconala_engineer
1
230
Milestoner
bkuhlmann
1
400
Build with AI 2024 Seoul - 제로부터 시작하는 Flutter with Gemini 생활 - 박제창
itsmedreamwalker
0
200
Ruby Pattern Matching
bkuhlmann
0
920
Git Rebase
bkuhlmann
11
1.6k
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
270
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
7
3.2k
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
180
甘い香りに誘われてVanilla Extractを1年間運用してみた
miyahkun
1
110
SwiftUI Performance 不要なViewの再描画と更新を抑える
bigamitiongit
1
150
エンターテイメント業界で利用されるAWS
demuyan
0
200
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
22
15k
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
266
39k
Pencils Down: Stop Designing & Start Developing
hursman
116
11k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Designing for Performance
lara
601
67k
How GitHub (no longer) Works
holman
304
140k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Agile that works and the tools we love
rasmusluckow
323
20k
Done Done
chrislema
178
15k
Building Your Own Lightsaber
phodgson
97
5.7k
Infographics Made Easy
chrislema
237
18k
The Brand Is Dead. Long Live the Brand.
mthomps
48
28k
The Language of Interfaces
destraynor
151
23k
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!!