Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Refactoring Ruby Edition
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Julio Lucero
April 05, 2013
Programming
240
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
Transcript
23 slides
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
More Decks by Julio Lucero
See All by Julio Lucero
Amazon as a Servide
julioalucero
0
52
Remix Manifest
julioalucero
0
160
Active Admin
julioalucero
0
420
Other Decks in Programming
See All in Programming
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
510
JavaScriptはシングルバイナリの夢を見るか / Does JavaScript Dream of a Single Binary?
ssssota
1
1.2k
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
680
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
130
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
250
R言語プログラミング
profjoesuzuki
0
140
SONY CISC-NEWS NWS-1750 + NWB-225 ハードウェアメンテとフレームバッファカラー対応 / KOF2026
tsutsui
0
150
AI駆動TDD ― 2026年10月版
hrmstrsmgs
0
120
The Cost of the DOM
ypresto
6
2.7k
Compiling Your Language to WasmGC & Friends
tanishiking
0
860
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
3
260
Apache Airflow Introduction
leew
1
100
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.3k
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
Done Done
chrislema
187
17k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
760
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
What's in a price? How to price your products and services
michaelherold
247
13k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The Invisible Side of Design
smashingmag
301
52k
Abbi's Birthday
coloredviolet
5
11k