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
65
Agile Retrospective
lagilaper
0
170
Culture Test
lagilaper
0
190
Introduction to Vagrant and Docker
lagilaper
0
95
Recap of Jordan DeaMattson TechTalk
lagilaper
0
360
Other Decks in Programming
See All in Programming
三者三様 宣言的UI
kkagurazaka
0
260
オープンソースソフトウェアへの解像度🔬
utam0k
17
3.2k
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
14
46k
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
120
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
190
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
820
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
200
AI駆動で0→1をやって見えた光と伸びしろ
passion0102
1
870
iOSでSVG画像を扱う
kishikawakatsumi
0
170
Software Architecture
hschwentner
6
2.3k
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
460
contribution to astral-sh/uv
shunsock
0
550
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
431
66k
Scaling GitHub
holman
463
140k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.7k
Into the Great Unknown - MozCon
thekraken
40
2.1k
Speed Design
sergeychernyshev
32
1.2k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Fireside Chat
paigeccino
41
3.7k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
Reflections from 52 weeks, 52 projects
jeffersonlam
354
21k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
Why Our Code Smells
bkeepers
PRO
340
57k
Product Roadmaps are Hard
iamctodd
PRO
55
11k
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!!