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
290
Metrics and Monitoring
lagilaper
0
57
Agile Retrospective
lagilaper
0
150
Culture Test
lagilaper
0
180
Introduction to Vagrant and Docker
lagilaper
0
88
Recap of Jordan DeaMattson TechTalk
lagilaper
0
340
Other Decks in Programming
See All in Programming
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.9k
良いユニットテストを書こう
mototakatsu
11
3.6k
return文におけるstd::moveについて
onihusube
1
1.4k
Rubyでつくるパケットキャプチャツール
ydah
0
170
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
170
ASP.NET Core の OpenAPIサポート
h455h1
0
110
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
180
PHPカンファレンス 2024|共創を加速するための若手の技術挑戦
weddingpark
0
140
rails newと同時に型を書く
aki19035vc
5
710
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
170
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Statistics for Hackers
jakevdp
797
220k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
Being A Developer After 40
akosma
89
590k
Become a Pro
speakerdeck
PRO
26
5.1k
Bash Introduction
62gerente
610
210k
Fireside Chat
paigeccino
34
3.1k
RailsConf 2023
tenderlove
29
970
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!!