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
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
870
The Patterns We All Need to Know
jeg2
15
1.3k
Command-line Ruby
jeg2
5
470
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
生成AIで高い生産性を求められて、 悩み、乗り越えた話
mot_techtalk
2
140
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
570
おそらく日本で唯一のDevRelインターン生として
husengs7
0
170
購入ドメインでの課題と取り組み
ykagano
0
150
しろおびから始める!ログ活用の第一歩
shumei_ito
0
800
OR学会2026年秋期大会_機械学習と数理最適化の融合による、配合レシピ最適化システム開発事例
brainpadpr
0
110
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
380
3つのアプローチで目指す チームを強くするAI駆動開発
thkt
0
140
Loop Engineering これくらいでいい
mikanichinose
0
130
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
110
オブザーバビリティを高める AI エージェント体験を考える / Designing AI Agent Experiences That Enhance Observability
aoto
PRO
2
320
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
2
610
Featured
See All Featured
Bash Introduction
62gerente
615
220k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
400
The Cult of Friendly URLs
andyhume
79
7k
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
450
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
570
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