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
読みやすいコードを書くために気をつけていること/ be-careful-when-writin...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Masatoshi Moritsuka
February 06, 2020
Programming
0
200
読みやすいコードを書くために気をつけていること/ be-careful-when-writing-readable-code
Masatoshi Moritsuka
February 06, 2020
Tweet
Share
More Decks by Masatoshi Moritsuka
See All by Masatoshi Moritsuka
Rails の CLI ツールの書き方/writing-rails-cli-tool
sanfrecce_osaka
0
37
Time.zone.parse('dark')/time-zone-parse-dark
sanfrecce_osaka
0
100
外部APIが絡むテストをちょっといい感じに書く/a-little-nice-writing-external-api-testing
sanfrecce_osaka
0
26
gem_rbs_collection へのコントリビュートから始める Ruby の型の世界/contributing-gem-rbs-collection
sanfrecce_osaka
0
540
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
450
パターンマッチ使ってるかい?(kyobashi.rb)/use-ruby-s-pattern-matching-on-kyobashi-rb
sanfrecce_osaka
0
230
ApplicationController の継承を分割してエラーを減らした話/dividing-application-controller
sanfrecce_osaka
1
380
Input object ではじめる入力値検証/input-value-validation-using-input-object
sanfrecce_osaka
0
580
実例で学ぶRailsアプリケーションデバッグ入門 〜ログインできちゃってました編〜/rails-application-debug-introduction
sanfrecce_osaka
2
890
Other Decks in Programming
See All in Programming
AI活用のコスパを最大化する方法
ochtum
0
120
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
320
Codex の「自走力」を高める
yorifuji
0
650
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
ご飯食べながらエージェントが開発できる。そう、Agentic Engineeringならね。
yokomachi
1
280
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
320
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
340
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
300
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
210
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
570
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
240
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
68
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
190
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
370
Chasing Engaging Ingredients in Design
codingconduct
0
130
GraphQLの誤解/rethinking-graphql
sonatard
75
11k
How to train your dragon (web standard)
notwaldorf
97
6.5k
Designing Experiences People Love
moore
143
24k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
65
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Designing for Performance
lara
611
70k
Designing Powerful Visuals for Engaging Learning
tmiket
0
260
Transcript
ಡΈ͍͢ίʔυΛॻͨ͘Ίʹ ؾΛ͚͍ͭͯΔ͜ͱ ௩ɹਅ(@sanfrecce_osaka) 2020/2/6ɹOmotesando.rb #omotesandorb
ࣗݾհ ➤ ௩ ਅ ➤ GitHub: @sanfrecce-osaka ➤ Twitter: @sanfrecce_osaka
➤ Qiita: @sanfrecce_osaka ➤ 9݄: େࡕ → ொా ➤ ruby-jpͷॅਓ ➤ גࣜձࣾϥάβΠΞ
ձࣾհ ➤ RubyɾRailsͷडୗ։ൃձࣾ ➤ at ொా ➤ ձࣾͷۙลͰՈ͕͍҆ʂ ➤ ະܦݧ͔ΒͰ2ϲ݄ͷݚम༗
➤ We are hiring!
ʲએʳMachida.rb͡Ί·ͨ͠
લஔ͖ ➤ ࣮RubyMineωλͰͦ͏ͱͯ͠அ೦͠·ͨ͠ ➤ ʮؾΛ͚͍ͭͯΔ͜ͱʯͳͷͰ࣮ફͰ͖͍ͯΔͱݶΒͳ͍ ➤ Ұ෦͜Ε͔Β͍ͬͯ͜͏ͱՃͨ͠ͷ͋Γ·͢ ➤ ίʔυྫશ͘༻ҙͰ͖ͯͳ͍Ͱ͢ ➤
ҙݟɾҟ͋ΕࢦఠΒ͑Δͱ͋Γ͕͍ͨͰ͢
ΠϯλʔϑΣʔεʹؾΛ͚ͭΔ ➤ ྑ͍ΠϯλʔϑΣʔεͱ(ݸਓతݟղ) ➤ ڍಈɾҾ͕ཧղ͍͢͠ ➤ ܕ͕ͳͯ͘ཧղͰ͖Δ(͋ͬͨํ͕ศར͚ͩͲ)
ΠϯλʔϑΣʔεͷཁૉ(ϝιουͷ߹) ➤ ໊લ ➤ ɾॲཧ༰͕දݱ͞Ε͍ͯΔ͔ ➤ ೖྗ ➤ ԿΛड͚औΔ͔ ➤
͍ͭɾͲ͜Ͱड͚औΔ͔ ➤ ग़ྗ ➤ ԿΛฦ͔͢
໋໊େࣄ ➤ ͍͞͞ͳͷͰ໋໊͢Δ ➤ ୯७ͳ݅ఆࣜΛϝιουʹΓग़͢ ➤ ϒϩοΫΛprocΛฦ͢ϝιουʹΓग़͢ ➤ ໋໊ͰखΛൈ͘ͱ͋ͱͰΊͪΌͪ͘Όਏ͍ ➤
໌ͷࣗผਓ ➤ ଞਓࣗͷ಄ͷதͷίϯςΩετΘ͔Βͳ͍ ➤ ్த͔Βࢀըͨ͠ਓʹྺ࢙తܦҢഎܠΘ͔Βͳ͍
None
ͦͷଞ ➤ ࠷ॳࡶʹॻ͘ ➤ ൚༻తʹ࡞Βͳ͍ ➤ ࠷ॳ͔Β100%ೲಘͷ͍͘ίʔυॻ͚ͳ͍ ➤ ϘʔΠεΧτɾϧʔϧʹଇͬͯίʔυΛॻ͘ ➤
ׂΕ૭ཧ ➤ SOLIDݪଇ
ʲࢀߟʳSOLIDݪଇ ➤ ୯Ұͷݪଇ(Single Responsibility Principle) ➤ ΦʔϓϯɾΫϩʔζυͷݪଇ(Open/closed principle) ➤ Ϧείϑͷஔݪଇ(Liskov
substitution principle) ➤ ΠϯλʔϑΣʔεͷ๏ଇ(Interface segregation principle) ➤ ґଘؔٯసͷݪଇ(Dependency inversion principle)
ࢀߟʹͳΔ υΩϡϝϯτɾॻ੶
Ruby on RailsΛͬͨ։ൃͰࢀরͯ͠Α͍υΩϡϝϯτ https://qiita.com/hanachin_/items/76a24bcef889edb59d19
style guide ➤ ruby-style-guide ➤ https://github.com/fortissimo1997/ruby-style-guide/blob/ japanese/README.ja.md ➤ rails-style-guide ➤
https://github.com/satour/rails-style-guide/blob/master/ README-jaJA.md ➤ rspec-style-guide ➤ https://github.com/willnet/rspec-style-guide ➤ ReactVueɺCSSʹstyle-guide͕͋Δ
Ϧʔμϒϧίʔυ
ίʔυίϯϓϦʔτ
Sandi Metzຊ
ΦϒδΣΫτࢦઃܭݪଇͱ https://qiita.com/UWControl/items/98671f53120ae47ff93a
ϓϥεЋ
ίϛοτ ϝοηʔδ
ίϛοτϝοηʔδΛॻ͘ͱ͖ʹؾΛ͚͍ͭͯΔ͜ͱ https://sinsoku.hatenablog.com/entry/2019/08/17/020954
ίϛοτϝοηʔδ͔ͬ͠Γॻ͘ཧ༝ ➤ ϨϏϡΞʔָ͕ ➤ ҙਤɾഎܠ͕Θ͔Δ ➤ ίʔυΛಡ·ͳͯ͘େےΛཧղͰ͖Δ ➤ ϨϏϡʔΠָ ➤
ޙʹϖΞɾϞϒϨϏϡʔ͕͋ͬͯରԠͰ͖Δ ➤ ͋ͱͰίʔυΛಡΉਓָ ➤ ྺ࢙తܦҢ͕Θ͔Δ ➤ ಡΉࡍͷใ͕૿͑Δ
ࣗͷ߹(ۀಉ͡ײ͡Ͱ͢) https://github.com/pocke/ruboty-ruby-jp/pull/24
͝ਗ਼ௌ ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂ