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
Why Best Practices?
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
jeg2
August 04, 2013
Technology
380
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Why Best Practices?
This is JEG2's segment of the Ruby Rogues panel form LSRC 2013.
jeg2
August 04, 2013
More Decks by jeg2
See All by jeg2
How to Level Up in Elixir
jeg2
2
200
Motivation
jeg2
1
150
Coding in the Classroom
jeg2
0
210
Implementing the LHC on a Whiteboard
jeg2
3
880
The Patterns We All Need to Know
jeg2
15
1.3k
Command-line Ruby
jeg2
5
500
10 Things You Didn't Know Ruby Could do
jeg2
200
54k
The Aspects of Programming
jeg2
12
990
The M Word
jeg2
3
1.1k
Other Decks in Technology
See All in Technology
Vue で書く 空間コンピューティング、TresJS と WebXR を使ったXR デバイスのフロントエンド開発
hiranuma
0
140
データマネジメント × 法務で作りあげる、 freeeの新しいデータガバナンスへの軌跡
freee
PRO
3
590
AWS Continuum for Penetration Testing に Deep Dive してみる
asanoharuki
2
1.5k
視野はAIに、視座は人に / ai-for-breadth-humans-for-perspective
nkzn
6
2.6k
AIコーディングエージェント開発_全体像
happysamurai294
0
140
Autonomous AI Lakehouse - Live AI Hubから始めるセキュアなAIデータ活用 -
oracle4engineer
PRO
2
180
素人でもできた!AIを使った短編小説創作入門
delhi09
PRO
0
270
E2Eってつらくないですか?E2Eの管理コストを下げる手段とその実践
akaboshinit
6
2.8k
ALBのLCU予約とトラフィックの波によるプロダクト理解 / Understanding ALB LCU and Traffic Spikes
mito201
1
120
AI Search (Foundry IQ) におけるRAGデータの準備と配置
ryomaru0825
1
110
詳解 never 型 - ボトム型の性質を深掘り
nealle
0
100
Systems Manager AgentがインストールされたPCを紛失した時の対策を考えてみた
amarelo_n24
1
110
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
590
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.7k
Agile that works and the tools we love
rasmusluckow
331
22k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Everyday Curiosity
cassininazir
0
380
エンジニアに許された特別な時間の終わり
watany
109
250k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Skip the Path - Find Your Career Trail
mkilby
1
270
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
290
The browser strikes back
jonoalderson
0
1.9k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Transcript
I Only Have Time to Make One Point The others
made me include this slide!
.
Thanks!
Why Best Practices?
How Should We Use Struct? class Specialized < Struct.new(:whatever) #
... define custom methods here... end Specialized = Struct.new(:whatever) do # ... define custom methods here... end
I Prefer the Block Form But that’s not the point!
Code Similarity and Malleability Specialized = Struct.new(:whatever) do # ...
define custom methods here... end Trivial = Struct.new(:whatever)
An Extra Class • The anonymous class doesn’t tell us
much • Code reloading may cause “TypeError: superclass mismatch…” [Specialized, #<Class:0x007f8ba7389d18>, Struct, Enumerable, Object, PP::ObjectMixin, Kernel, BasicObject] class Specialized < Struct.new(:whatever) # ... define custom methods here... end
The “super” Problem class Specialized < Struct.new(:whatever) def whatever super
|| :default end include SomeMixin end Specialized = Struct.new(:whatever) do def whatever self[:whatever] || :default end prepend SomeMixin end
The Point • It’s not about the one right way
to code • It’s about what we learn in the discussion • This trivial example alone includes: • Code malleability • The ancestor class chain • The value of prepend