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
refactoring
Search
coldclimate
July 16, 2012
Technology
1
120
refactoring
a talk about making code more betterer. Contains invented words and a little swering
coldclimate
July 16, 2012
Tweet
Share
More Decks by coldclimate
See All by coldclimate
You don't scale like servers scale
coldclimate
0
110
Quick and dirty load testing with Vegeta
coldclimate
3
3.9k
Continuously deploying https served statically compiled sites to S3 with canonical domains
coldclimate
0
60
Scripting creating AWS based servers
coldclimate
0
210
Scaling CANDDi
coldclimate
0
200
Other Decks in Technology
See All in Technology
成長をサポートするピープルマネジメントのやり方
sioncojp
9
1.2k
生産性向上チームの紹介
cybozuinsideout
PRO
1
920
認知症フレンドリーテックとスタックチャン
naokiuc
0
250
MLOpsの「壁」を乗り越える、LINEヤフーの Data Quality as Code
lycorptech_jp
PRO
8
620
Google Cloud Next '24 Recap(Cloud Run/k8s)
mokocm
0
330
Amplify 🩷 Bedrock 〜生成AI入門〜
minorun365
PRO
8
720
BPStudyの200回を中心にIT業界を振り返る。そしてこれから
haru860
3
410
AWS学習者向けにAzureの解説スライドを作成した話
handy
3
190
プロンプトエンジニアリングでがんばらない-Agentic Workflow へ-近藤憲児
kenjikondobai
6
1.2k
How to Lead? Testimonial of a Lead Android Engineer
oleur
1
110
コードや知識を組み込む / Incorporate Code and knowledge
ks91
PRO
0
150
20分で完全に理解するGrafanaダッシュボード
hamadakoji
5
890
Featured
See All Featured
Infographics Made Easy
chrislema
238
18k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
117
18k
Raft: Consensus for Rubyists
vanstee
133
6.3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.4k
Embracing the Ebb and Flow
colly
80
4.2k
A Modern Web Designer's Workflow
chriscoyier
689
190k
Design by the Numbers
sachag
274
18k
Navigating Team Friction
lara
179
13k
Side Projects
sachag
451
41k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
Transcript
Refactoring Oli Wood @coldclimate
What How Tools When
2,300 lines single file no classes 2 years old
"too important to risk breaking it"
"make it do this..."
what
replacing what is there with something new
that does exactly the same thing
same functionality
...faster
...securer
...extendable
...maintainabler
...more better
how
work out what it actually does (you think)
...high level
fits into a couple of paragraphs
...low level
function by function docblock it
find out what it actually does
including the bits everybody forgot
document its API/interface/what ever
unit tests*
Redesign it
high level logical grouping
Class structure
...think design patterns (maybe)
work out where you are going
...and get there step at a time
...nail the bit you're working on
...don't have too many balls in the air
...#TODO this thing you will forget
...#SHOULDDO ace thing you might do later
...keep running the tests
...and stop at 80%
tools
sublime text
redacted
grep -Rin
phpunit
Selenium
ghetto tests (curl > Apache logs > *nix > diff)
code formatters
php codesniffer
php coding standards fixer
when
Refactoring is a good sign you're thinking about the code
...constant refactoring is geek circle jerk
...man up and live with it
...when it stops you doing something more important
...when you know what you're doing
...once the cost of not doing it out weighs that
of doing it
...when can't stand it any more
16 files object orientated does exactly the same thing
2 new modules Several £k income Multi-developer
A confession
FIN