$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Refactoring Ruby Edition
Search
Julio Lucero
April 05, 2013
Programming
2
220
Refactoring Ruby Edition
Slides based on the book: "Refactoring: Ruby Edition"
Julio Lucero
April 05, 2013
Tweet
Share
More Decks by Julio Lucero
See All by Julio Lucero
Amazon as a Servide
julioalucero
0
37
Remix Manifest
julioalucero
0
140
Active Admin
julioalucero
0
410
Other Decks in Programming
See All in Programming
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
160
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
170
AIコーディングエージェント(Gemini)
kondai24
0
280
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
630
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
170
Implementation Patterns
denyspoltorak
0
120
ローカルLLMを⽤いてコード補完を⾏う VSCode拡張機能を作ってみた
nearme_tech
PRO
0
170
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
640
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
160
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
130
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
360
Featured
See All Featured
Abbi's Birthday
coloredviolet
0
3.8k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
92
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
69
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
22
Build your cross-platform service in a week with App Engine
jlugia
234
18k
A better future with KSS
kneath
240
18k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
65
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Why Our Code Smells
bkeepers
PRO
340
57k
A Tale of Four Properties
chriscoyier
162
23k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
65
35k
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