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
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
150
Active Admin
julioalucero
0
410
Other Decks in Programming
See All in Programming
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
100
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
430
Java 21/25 Virtual Threads 소개
debop
0
300
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
160
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
100
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1.2k
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
660
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
190
モダンOBSプラグイン開発
umireon
0
190
20260320登壇資料
pharct
0
140
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
270
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
160
A Tale of Four Properties
chriscoyier
163
24k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Typedesign – Prime Four
hannesfritz
42
3k
Designing Powerful Visuals for Engaging Learning
tmiket
1
310
Rails Girls Zürich Keynote
gr2m
96
14k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
140
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Music & Morning Musume
bryan
47
7.1k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
How to Ace a Technical Interview
jacobian
281
24k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
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