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
61
Agile Retrospective
lagilaper
0
160
Culture Test
lagilaper
0
190
Introduction to Vagrant and Docker
lagilaper
0
93
Recap of Jordan DeaMattson TechTalk
lagilaper
0
360
Other Decks in Programming
See All in Programming
MCPを使ってイベントソーシングのAIコーディングを効率化する / Streamlining Event Sourcing AI Coding with MCP
tomohisa
0
170
顧客の画像データをテラバイト単位で配信する 画像サーバを WebP にした際に起こった課題と その対応策 ~継続的な取り組みを添えて~
takutakahashi
4
1.2k
新メンバーも今日から大活躍!SREが支えるスケールし続ける組織のオンボーディング
honmarkhunt
5
8.6k
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
340
AI駆動のマルチエージェントによる業務フロー自動化の設計と実践
h_okkah
0
220
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
680
ISUCON研修おかわり会 講義スライド
arfes0e2b3c
1
460
Model Pollution
hschwentner
1
160
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
170
AI コーディングエージェントの時代へ:JetBrains が描く開発の未来
masaruhr
1
200
Porting a visionOS App to Android XR
akkeylab
0
670
Goで作る、開発・CI環境
sin392
0
260
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Agile that works and the tools we love
rasmusluckow
329
21k
Scaling GitHub
holman
460
140k
Building Adaptive Systems
keathley
43
2.7k
Why Our Code Smells
bkeepers
PRO
337
57k
Code Review Best Practice
trishagee
69
19k
Faster Mobile Websites
deanohume
308
31k
Practical Orchestrator
shlominoach
189
11k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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!!