Upgrade to Pro — share decks privately, control downloads, hide ads and more …

読みやすいコードを書くために気をつけていること/ be-careful-when-writin...

読みやすいコードを書くために気をつけていること/ be-careful-when-writing-readable-code

Masatoshi Moritsuka

February 06, 2020
Tweet

More Decks by Masatoshi Moritsuka

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ ➤ ৿௩ ਅ೥ ➤ GitHub: @sanfrecce-osaka ➤ Twitter: @sanfrecce_osaka

    ➤ Qiita: @sanfrecce_osaka ➤ 9݄: େࡕ → ொా ➤ ruby-jpͷॅਓ ➤ גࣜձࣾϥάβΠΞ
  2. ໋໊େࣄ ➤ ͍͞͞ͳ΋ͷͰ΋໋໊͢Δ ➤ ୯७ͳ৚݅൑ఆࣜΛϝιουʹ੾Γग़͢ ➤ ϒϩοΫΛprocΛฦ͢ϝιουʹ੾Γग़͢ ➤ ໋໊ͰखΛൈ͘ͱ͋ͱͰΊͪΌͪ͘Όਏ͍ ➤

    ໌೔ͷࣗ෼͸ผਓ ➤ ଞਓ͸ࣗ෼ͷ಄ͷதͷίϯςΩετ͸Θ͔Βͳ͍ ➤ ్த͔Βࢀըͨ͠ਓʹ͸ྺ࢙తܦҢ΍എܠ౳͸Θ͔Βͳ͍
  3. ʲࢀߟʳSOLIDݪଇ ➤ ୯Ұ੹೚ͷݪଇ(Single Responsibility Principle) ➤ ΦʔϓϯɾΫϩʔζυͷݪଇ(Open/closed principle) ➤ Ϧείϑͷஔ׵ݪଇ(Liskov

    substitution principle) ➤ ΠϯλʔϑΣʔε෼཭ͷ๏ଇ(Interface segregation principle) ➤ ґଘؔ܎ٯసͷݪଇ(Dependency inversion principle)
  4. 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 ➤ React΍VueɺCSSʹ΋style-guide͕͋Δ
  5. ίϛοτϝοηʔδ͔ͬ͠Γॻ͘ཧ༝ ➤ ϨϏϡΞʔָ͕ ➤ ҙਤɾഎܠ౳͕Θ͔Δ ➤ ίʔυΛಡ·ͳͯ͘΋େےΛཧղͰ͖Δ ➤ ϨϏϡʔΠ΋ָ ➤

    ਺೔ޙʹϖΞɾϞϒϨϏϡʔ͕͋ͬͯ΋ରԠͰ͖Δ ➤ ͋ͱͰίʔυΛಡΉਓ΋ָ ➤ ྺ࢙తܦҢ͕Θ͔Δ ➤ ಡΉࡍͷ৘ใ͕૿͑Δ