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 Ruby Edition
Search
Julio Lucero
April 05, 2013
Programming
230
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Refactoring Ruby Edition
Slides based on the book: "Refactoring: Ruby Edition"
Julio Lucero
April 05, 2013
More Decks by Julio Lucero
See All by Julio Lucero
Amazon as a Servide
julioalucero
0
43
Remix Manifest
julioalucero
0
150
Active Admin
julioalucero
0
420
Other Decks in Programming
See All in Programming
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
120
FastAPI の並行処理モデルを完全に理解する
hoto17296
8
3k
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
500
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
100
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
110
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
280
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.2k
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
240
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
1
470
ALB ログから Trace を気合で繋げる技術
fohte
3
250
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
240
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
480
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
810
Producing Creativity
orderedlist
PRO
348
40k
エンジニアに許された特別な時間の終わり
watany
108
250k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
480
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
580
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Bash Introduction
62gerente
615
220k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
490
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
30 Presentation Tips
portentint
PRO
1
380
Embracing the Ebb and Flow
colly
88
5.1k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Transcript
Refactoring Rubylit Edition @julioalucero
An Example
An Example
None
“A change made of the internal structure of software to
make it easier to understand and cheaper to modify without changing its observable behavior”
THE TWO HATS
WHY SHOULD YOU REFACTOR? • Mejora el diseño del software
• Hace que el software sea más fácil de entender • Ayuda a encontrar errores • Ayuda a Programar más Rápido
BAD SMELLS IN CODE
THE VALUES OF THE TESTS
Kinds of Refactorings 1. Composing Methods 2. Moving Features Between
Objects 3. Organization Data 4. Simplifying Conditional Expressions 5. Making Method Calls Simpler 6. Dealing with Generalization
1. COMPOSING METHODS
2. MOVING FEATURES BETWEEN OBJECTS
2. MOVING FEATURES BETWEEN OBJECTS
3. Organization Data row = [ ] row[0] = "Bichi
Gol" row[1] = "20" # refactoring row = Player.new row.name = "Bichi Gol" row.goals = "20" Replace Array with Object
4. Simplifying Conditionals Expressions
4. Simplifying Conditionals Expressions
4. Simplifying Conditionals Expressions
5. MAKING METHOD CALLS SIMPLER
6. DEALING WITH GENERALIZATION • Pull Up/Down Method • Extract
Module • Extract Subclass • Introduce Inheritance
6. DEALING WITH GENERALIZATION
6. DEALING WITH GENERALIZATION
Guarda que termina. • Solid suite of test. • Always
in small steps. • Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
ESTE ES EL FINAL