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
Rubyらしさとは?
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Aki Nakahara
May 22, 2025
Programming
33
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rubyらしさとは?
Aki Nakahara
May 22, 2025
More Decks by Aki Nakahara
See All by Aki Nakahara
AI時代に、あえてHTTPサーバー自作している話
akinko_0915
0
31
AIに丸投げしない!Angularメジャーアップデートで実践したAI活用法
akinko_0915
0
39
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
240
はじめてのWeb API体験 ー 飲食店検索アプリを作ろうー
akinko_0915
0
310
ワイガヤLT会 #2:gitの「めんどくさい」を解決
akinko_0915
0
29
Other Decks in Programming
See All in Programming
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
150
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3k
続・コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions-again
handlename
0
130
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
190
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
150
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
1.1k
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
150
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
190
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
280
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
11
6.8k
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
5
1.1k
Railsバージョンを4倍にした話
optim
0
800
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
It's Worth the Effort
3n
188
29k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Language of Interfaces
destraynor
162
27k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Utilizing Notion as your number one productivity tool
mfonobong
4
630
Git: the NoSQL Database
bkeepers
PRO
433
67k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
550
Transcript
Rubyらしさとは akinko0915 (あきんこ)
自己紹介 akinko0915 (あきんこ) 中原 暁 (なかはら あき) Classi株式会社 25卒 JavaScriptと非同期処理を極めるために特訓中
Zennで学習記録投稿中!(@akinko0915) Podcast配信中 (前向くラジオ)
カレンダーアプリのプラクティスで受けた指摘 発表テーマの背景
Rubyらしいコードとは・・・?
Rubyist Magazineにも「Rubyらしさ」について語られている 多くのライブラリが別途インストールする必要なく使えるよう になり、利便性は非常に高まったのだが、いくつかのライブラ リに関しては「Ruby らしくない」 という評価を聞いた。具 体的には、メソッドの名前付けや挙動が Ruby の標準的なクラ
スのそれとずれがある、といった指摘である。 こうなると、 Ruby を使う上での直感が効きにくくなるため、 プログラミン グにも影響を及ぼす。 しかしこのような「Ruby らしさ」は 明文化されていないため、 共有がしづらい 「Rubyらしさ」について Rubyist Magazine 0003号 巻頭言 るびま編集長 高橋征義
自分なりに「Rubyらしさ」を 定義してみたい
Rubyならでは! と思った書き方3つ
❶ 繰り返し処理 Array や Hash は Enumerable モジュールを include しているため、each,
map, select, each_with_index などの 繰り返しメソッドが使える
each_with_index
メソッドをうまく活用することができれば 繰り返し分の中でより幅広い処理を 簡潔に実装できるようになる
❷ 条件分岐の書き方 否定条件の書き方 後置でunlessを使用する
❷ 条件分岐の書き方 後置if 後置でifを使用する
endがなく1行で処理を完結させることができる 後置if やunlessにすることで 英語の表現のように書くことができ 人間が読みやすいコードになっている
❸ timesを使う 3.timesとすることで 「3回繰り返す」ことが わかりやすく表現されている
直感的に意図を 読み取ることができるコード
Rubyのメソッドを使い、様々な処理を簡潔 に表現できるコード 人間が話すような言葉で書くこと まとめ:Rubyらしさとは
つまり、Rubyらしさとは 「人間が読みやすい言語」
追記 ChatGPTに、Rubyらしさがみられるコードの書き方を 聞いたところ以下のような回答がありました。
Thank you