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
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
890
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
6
1.9k
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
140
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
Oxlint JS plugins
kazupon
1
580
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
180
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
RailsConf 2023
tenderlove
30
1.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
750
AI: The stuff that nobody shows you
jnunemaker
PRO
2
240
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Odyssey Design
rkendrick25
PRO
1
490
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
63
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
4 Signs Your Business is Dying
shpigford
187
22k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
130
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
64
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