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
Why Best Practices?
Search
jeg2
August 04, 2013
Technology
360
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
190
Motivation
jeg2
1
150
Coding in the Classroom
jeg2
0
190
Implementing the LHC on a Whiteboard
jeg2
3
860
The Patterns We All Need to Know
jeg2
15
1.3k
Command-line Ruby
jeg2
5
460
10 Things You Didn't Know Ruby Could do
jeg2
200
54k
The Aspects of Programming
jeg2
12
980
The M Word
jeg2
3
1.1k
Other Decks in Technology
See All in Technology
型落ちシンクライアント端末のPoEモジュールを自作したかった話
logica0419
0
490
OAuth SPIFFE Client Authentication(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
320
Claude Codeで開発以外の業務も爆速化しよう!
minorun365
PRO
9
8.2k
形式手法特論:Hyperproperty とモデル検査 #kernelvm / Kernel VM Study Tokyo 19th
ytaka23
0
850
dbt in Microsoft Fabric
ryomaru0825
0
290
hookで自作する Claude Code の「実況ボード」
shinyasaita
1
160
アクセスキーが漏れた日にやるべきこと- 無効化の先にある本当の対応
kazzpapa3
0
350
サーバー常駐型の 簡易障害調査AI エージェントを作ってみた話
masayoshi
0
230
アクセスキー流出時の対応で再認識した攻撃側と防御側の非対称性について
kazzpapa3
0
400
紙 to デジタル
ichien178
0
280
EUDIWの枠組みを出発点に民間エコシステムの在り方を考える(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
310
会計事務所と顧問先の契約関係をOIDC・OAuthで表現する
terara
0
460
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
540
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
500
HDC tutorial
michielstock
2
820
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Speed Design
sergeychernyshev
33
2k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
480
The Pragmatic Product Professional
lauravandoore
37
7.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
310
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