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.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
66
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
CSC307 Lecture 07
javiergs
PRO
1
560
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
170
Package Management Learnings from Homebrew
mikemcquaid
0
240
Swift at Scale: Where Performance Really Comes From
kateinoigakukun
0
110
NetBSD+Raspberry Piで 本物のPSGを鳴らすデモを OSC駆動の7日間で作った話 / OSC2026Osaka
tsutsui
1
110
Python’s True Superpower
hynek
0
170
Gemini for developers
meteatamel
0
110
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
Oxlint JS plugins
kazupon
1
1k
Event Storming
hschwentner
3
1.3k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
850
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
380
The SEO Collaboration Effect
kristinabergwall1
0
360
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
220
Embracing the Ebb and Flow
colly
88
5k
The Cult of Friendly URLs
andyhume
79
6.8k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
260
The Spectacular Lies of Maps
axbom
PRO
1
540
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
130
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
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!!