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
60
Agile Retrospective
lagilaper
0
150
Culture Test
lagilaper
0
190
Introduction to Vagrant and Docker
lagilaper
0
91
Recap of Jordan DeaMattson TechTalk
lagilaper
0
350
Other Decks in Programming
See All in Programming
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
620
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
21
4.8k
MCP世界への招待: AIエンジニアが創る次世代エージェント連携の世界
gunta
4
840
Windows版PHPのビルド手順とPHP 8.4における変更点
matsuo_atsushi
0
390
マルチアカウント環境での、そこまでがんばらない RI/SP 運用設計
wa6sn
0
680
remix + cloudflare workers (DO) docker上でいい感じに開発する
yoshidatomoaki
0
120
SEAL - Dive into the sea of search engines - Symfony Live Berlin 2025
alexanderschranz
1
110
AIコーディングワークフローの試行 〜AIエージェント×ワークフローでの自動化を目指して〜
rkaga
2
2k
S3静的ホスティング+Next.js静的エクスポート で格安webアプリ構築
iharuoru
0
210
データベースエンジニアの仕事を楽にする。PgAssistantの紹介
nnaka2992
9
4.4k
Day0 初心者向けワークショップ実践!ソフトウェアテストの第一歩
satohiroyuki
0
780
SQL Server ベクトル検索
odashinsuke
0
150
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
6
360
The Cost Of JavaScript in 2023
addyosmani
48
7.6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
500
Become a Pro
speakerdeck
PRO
27
5.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Site-Speed That Sticks
csswizardry
4
460
How STYLIGHT went responsive
nonsquared
99
5.4k
Making Projects Easy
brettharned
116
6.1k
Code Reviewing Like a Champion
maltzj
522
39k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
29
2k
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!!