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
Rubyらしさとは?
Search
Aki Nakahara
May 22, 2025
Programming
22
0
Share
Rubyらしさとは?
Aki Nakahara
May 22, 2025
More Decks by Aki Nakahara
See All by Aki Nakahara
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
180
はじめてのWeb API体験 ー 飲食店検索アプリを作ろうー
akinko_0915
0
280
ワイガヤLT会 #2:gitの「めんどくさい」を解決
akinko_0915
0
18
Other Decks in Programming
See All in Programming
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
120
[RubyKaigi 2026] Require Hooks
palkan
1
310
Are We Really Coding 10× Faster with AI?
kohzas
0
150
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
770
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
630
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
200
空間オーディオの活用
objectiveaudio
0
150
AI時代になぜ書くのか
mutsumix
0
380
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
170
SkillsをS3 Filesに置く時のあれこれ
watany
3
1.5k
Agentic Elixir
whatyouhide
0
450
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
3
340
Featured
See All Featured
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
500
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
180
Raft: Consensus for Rubyists
vanstee
141
7.4k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
370
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Test your architecture with Archunit
thirion
1
2.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
690
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
The agentic SEO stack - context over prompts
schlessera
0
780
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