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
340
3
Share
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
170
Motivation
jeg2
1
140
Coding in the Classroom
jeg2
0
170
Implementing the LHC on a Whiteboard
jeg2
3
830
The Patterns We All Need to Know
jeg2
15
1.2k
Command-line Ruby
jeg2
5
460
10 Things You Didn't Know Ruby Could do
jeg2
200
54k
The Aspects of Programming
jeg2
12
960
The M Word
jeg2
3
1.1k
Other Decks in Technology
See All in Technology
Kubernetesの「隠れメモリ消費」によるNode共倒れと、Request適正化という処方箋
g0xu
0
170
AIエージェント時代に必要な オペレーションマネージャーのロールとは
kentarofujii
0
260
契約書からの情報抽出を行うLLMのスループットを、バッチ処理を用いて最大40%改善した話
sansantech
PRO
3
330
開発チームとQAエンジニアの新しい協業モデル -年末調整開発チームで実践する【QAリード施策】-
qa
0
650
スクラムを支える内部品質の話
iij_pr
0
150
LLMに何を任せ、何を任せないか
cap120
11
6.8k
JSTQB Expert Levelシラバス「テストマネジメント」日本語版のご紹介
ymty
0
100
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
2
17k
JEDAI認定プログラム JEDAI Order 2026 受賞者一覧 / JEDAI Order 2026 Winners
databricksjapan
0
430
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
4
1.3k
AIにより大幅に強化された AWS Transform Customを触ってみる
0air
0
260
PostgreSQL 18のNOT ENFORCEDな制約とDEFERRABLEの関係
yahonda
0
150
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
240
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
160
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
140
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
140
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
200
Navigating Team Friction
lara
192
16k
Why Our Code Smells
bkeepers
PRO
340
58k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Designing Powerful Visuals for Engaging Learning
tmiket
1
320
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