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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
850
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
シンガポールで登壇してきます
yama3133
0
180
人を動かすのは時間ではなく、納得感 〜新任EMが入社3ヶ月、組織を2回変えた話〜
kakehashi
PRO
3
240
kintone の AI コワーカーを、 Anthropic にエージェントを"ホストさせて"作った話 #devkinmeetup
sugimomoto
0
110
LLM/Agent評価:トップ営業の発言を「正解」にする 〜暗黙的正解による評価を営業資産に変える〜
takkuhiro
1
220
AI Coding Agent時代のcdk-nagガードレール 〜組織ルールを強制CIで守り抜く設計の挑戦〜
mhrtech
3
250
ruby.wasmとPicoRuby.wasmに対応した仮想DOMライブラリを作ってる話 #kaigieffect_kaigi
sue445
PRO
0
150
Type-safe IaC for Dart
coborinai
0
110
AmplifyHostingConstructからSSRフレームワークのためのホスティング設計を考察する/amplify-hosting-construct
fossamagna
1
100
Gen3R: 3D Scene Generation Meets Feed-Forward Reconstruction
spatial_ai_network
0
130
Making sense of Google’s agentic dev tools
glaforge
1
230
SREとQA 二人三脚で進めるSLO運用/sre-qa-slo
sugitak
0
630
世界、断片、モデル。そして理解
ardbeg1958
1
120
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
The Art of Programming - Codeland 2020
erikaheidi
57
14k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
750
Balancing Empowerment & Direction
lara
6
1.2k
4 Signs Your Business is Dying
shpigford
187
22k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
900
Technical Leadership for Architectural Decision Making
baasie
3
440
Making Projects Easy
brettharned
120
6.7k
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.4k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
200
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