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
Masatoshi Moritsuka
February 06, 2020
Programming
0
180
読みやすいコードを書くために気をつけていること/ be-careful-when-writing-readable-code
Masatoshi Moritsuka
February 06, 2020
Tweet
Share
More Decks by Masatoshi Moritsuka
See All by Masatoshi Moritsuka
gem_rbs_collection へのコントリビュートから始める Ruby の型の世界/contributing-gem-rbs-collection
sanfrecce_osaka
0
140
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
270
パターンマッチ使ってるかい?(kyobashi.rb)/use-ruby-s-pattern-matching-on-kyobashi-rb
sanfrecce_osaka
0
130
ApplicationController の継承を分割してエラーを減らした話/dividing-application-controller
sanfrecce_osaka
1
200
Input object ではじめる入力値検証/input-value-validation-using-input-object
sanfrecce_osaka
0
390
実例で学ぶRailsアプリケーションデバッグ入門 〜ログインできちゃってました編〜/rails-application-debug-introduction
sanfrecce_osaka
2
680
String#split何もわかっていなかった/didn_t_know_anything_about_string_split
sanfrecce_osaka
0
120
String#split何もわかっていなかった/didn-t-know-anything-about-string-split
sanfrecce_osaka
0
52
パターンマッチ使ってるかい?/use-ruby-s-pattern-matching?
sanfrecce_osaka
0
800
Other Decks in Programming
See All in Programming
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
1k
みんなでプロポーザルを書いてみた
yuriko1211
0
280
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Quine, Polyglot, 良いコード
qnighy
4
650
Jakarta EE meets AI
ivargrimstad
0
260
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.3k
CSC509 Lecture 13
javiergs
PRO
0
110
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
Vapor Revolution
kazupon
1
130
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
1
110
Amazon Qを使ってIaCを触ろう!
maruto
0
420
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
A better future with KSS
kneath
238
17k
Done Done
chrislema
181
16k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
KATA
mclloyd
29
14k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
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
͝ਗ਼ௌ ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂ