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
0
20
Rubyらしさとは?
Aki Nakahara
May 22, 2025
Tweet
Share
More Decks by Aki Nakahara
See All by Aki Nakahara
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
170
はじめてのWeb API体験 ー 飲食店検索アプリを作ろうー
akinko_0915
0
270
ワイガヤLT会 #2:gitの「めんどくさい」を解決
akinko_0915
0
16
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
1.2k
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
480
存在論的プログラミング: 時間と存在を記述する
koriym
5
580
20260315 AWSなんもわからん🥲
chiilog
2
180
Nuxt Server Components
wattanx
0
210
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
180
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
370
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
120
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
570
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
120
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
3.4k
AI Assistants for YourAngular Solutions @Angular Graz, March 2026
manfredsteyer
PRO
0
130
Featured
See All Featured
Accessibility Awareness
sabderemane
0
87
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
310
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
160
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
200
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
400
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Tell your own story through comics
letsgokoyo
1
870
Mind Mapping
helmedeiros
PRO
1
140
The Spectacular Lies of Maps
axbom
PRO
1
660
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
190
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