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

読みやすいコードの書き方 第 1 回 / Code readability: Session 1 (ver. 2, Ja)

読みやすいコードの書き方 第 1 回 / Code readability: Session 1 (ver. 2, Ja)

第 1 回: 導入と原則

---

セッションリスト

第 1 回: 導入と原則
- https://speakerdeck.com/munetoshi/code-readability-session-1-ver-2-ja

第 2 回: 命名
- https://speakerdeck.com/munetoshi/code-readability-session-2-ver-2-ja

第 3 回: コメント
- https://speakerdeck.com/munetoshi/code-readability-session-3-ver-2-ja

第 4 回: 状態
- https://speakerdeck.com/munetoshi/code-readability-session-4-ver-2-ja

第 5 回: 関数
- https://speakerdeck.com/munetoshi/code-readability-session-5-ver-2-ja

第 6 回: 依存関係 I
- https://speakerdeck.com/munetoshi/code-readability-session-6-ver-2-ja

第 7 回: 依存関係 II
- https://speakerdeck.com/munetoshi/code-readability-session-7-ver-2-ja

第 8 回: レビュー
- https://speakerdeck.com/munetoshi/code-readability-session-8-ver-2-ja

---

関連書籍 「読みやすいコードのガイドライン - 持続可能なソフトウェア開発のために」
- https://gihyo.jp/book/2022/978-4-297-13036-7

英語版のリスト: https://gist.github.com/munetoshi/65a1b563fb2c271f328c121a4ac63571#file-code-readability-links-md

以前のバージョン (英語): https://speakerdeck.com/munetoshi/code-readability

© 2019-2023 Munetoshi Ishikawa, supported by LINE corporation

Munetoshi Ishikawa

May 11, 2023
Tweet

More Decks by Munetoshi Ishikawa

Other Decks in Programming

Transcript

  1. ಡΈ΍͍͢ίʔυͷॻ͖ํ

    View full-size slide

  2. ॻ੶ʹ͍ͭͯ
    ಡΈ΍͍͢ίʔυͷΨΠυϥΠϯ
    - ࣋ଓՄೳͳιϑτ΢ΣΞ։ൃͷͨΊʹ
    - 2022೥10݄22೔ग़൛, ٕज़ධ࿦ࣾ
    https://gihyo.jp/book/
    2022/978-4-297-13036-7

    View full-size slide

  3. ಡΈ΍͍͢ίʔυͷॻ͖ํ ୈ 1 ճ
    ಋೖͱݪଇ

    View full-size slide

  4. ಡΈ΍͍͢ίʔυͷཁ݅
    - ໌֬: flag ΑΓ isVisible
    - ୯७: !(!isA || !isB) && isB ΑΓ isA && isB
    - ಠཱੑ͕ߴ͍: ؔ਺, Ϋϥε, Ϟδϡʔϧ...
    - ߏ଄త: ϑΥʔϚοτ, ґଘؔ܎, ঢ়ଶભҠ...
    ҰͭͷࢦඪͰ͸ಡΈ΍͢͞ΛଌΕͳ͍
    ʮԿ͕ಡΈ΍͍͔͢ʯ͸࣌୅ͱίϯςΩετʹґଘ͢Δ
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  5. ಡΈ΍͢͞ͷඞཁੑ
    ϓϩμΫτͷن໛͕େ͖͘ͳͬͯ΋
    ੜ࢈ੑΛҡ࣋͢ΔͨΊ
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  6. ϓϩμΫτͷن໛ͱੜ࢈ੑ
    ։ൃن໛͕େ͖͘ͳΔ → ੜ࢈ੑ্͕͕Γʹ͍͘
    ಡΈ΍͢͞: ։ൃΛܧଓ͠΍͘͢͢Δखஈ
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  7. ϓϩμΫτͷن໛ͱίʔυͷಡΈ΍͢͞
    ن໛͕େ͖͘ͳΔ΄Ͳ ಡΉ࣌ؒ > ॻ࣌ؒ͘
    - ػೳ࣮૷࣌ͷطଘίʔυͷཧղ
    - ؔ࿈։ൃऀʹίʔυϨϏϡʔґཔ
    - ෳࡶͳόάͷ 1 ߦमਖ਼
    ॻ͖΍͢͞ΑΓಡΈ΍͕͢͞ॏཁ
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  8. ੜ࢈ੑͷ࠷దԽ
    νʔϜશମ ˍ ϓϩμΫτण໋શظؒ ͷੜ࢈ੑ͕ॏཁ
    5 ෼ͷվળͰଞͷਓͷ 1 ࣌ؒΛٹ͑Δ͔΋
    ίϝϯτ΍ςετͷ௥Ճɾͪΐͬͱͨ͠ϦϑΝΫλϦϯά
    ։ൃऀͷධՁج४ͷมߋ͕ඞཁ͔΋
    ୹ظؒͷ࣮૷଎౓ͷΈʹয఺Λͯͯ͸͍͚ͳ͍
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  9. νʔϜͷੜ࢈ੑͱनਓͷδϨϯϚ
    ݸਓͷੜ࢈ੑ Ͱ࠷దԽ͢Δͱ νʔϜͷੜ࢈ੑ ͸Լ͕ΓಘΔ
    Bob
    Alice Hacky
    Readable
    Readable
    Hacky
    8
    8
    10
    1
    1
    10
    2
    2
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  10. ՄಡੑΛߴΊΔऔΓ૊Έํ
    - ஌ࣝ΍ٕज़Λબ୒͢Δ ʢ࢖͏໨తΛݟࣦΘͳ͍ʣ
    - Ձ஋ͱෳࡶ͞ͷόϥϯε ΛऔΔ
    - ࣗಈతͳݕূ Λ׆༻͢Δ ʢίϯύΠϥ, ςετ, etc.ʣ
    - ٞ࿦Λසൟʹߦ͏ ʢϛεͷख໭ΓΛখ͘͢͞Δʣ
    - ܧଓֶͯ͠श͢Δ
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  11. ίʔυͷॻ͖ํͷֶश
    ࣮૷͢Δ͚ͩͳΒൺֱత؆୯
    ಛผͳτϨʔχϯά͸ෆཁ
    ಡΈ΍͍͢ίʔυΛॻ͘͜ͱ͸೉͍͠
    - ߨٛɾॻ੶ɾΦϯϥΠϯࢿྉ
    - ίʔυϨϏϡʔɾϖΞϓϩάϥϛϯά
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  12. ߨٛͷߏ੒
    - ಋೖͱݪଇ
    - ࣗવݴޠ: ໋໊, ίϝϯτ
    - ܕͷߏ଄: ঢ়ଶ, ؔ਺
    - ܕؒͷߏ଄: ґଘؔ܎I, ґଘؔ܎II
    - ϨϏϡʔ
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  13. ߨٛͷߏ੒
    - ಋೖͱݪଇ
    - ࣗવݴޠ: ໋໊, ίϝϯτ
    - ܕͷߏ଄: ঢ়ଶ, ؔ਺
    - ܕؒͷߏ଄: ґଘؔ܎I, ґଘؔ܎II
    - ϨϏϡʔ
    ಋೖͱݪଇ > ಋೖ

    View full-size slide

  14. ࠓճͷ಺༰
    - ಋೖ
    - ϘʔΠεΧ΢τϧʔϧ
    - YAGNIɹ
    - KISSɹ
    - ୯Ұ੹೚ݪଇ
    - ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ
    ಋೖͱݪଇ > ݪଇ

    View full-size slide

  15. ࠓճͷ಺༰
    - ಋೖ
    - ϘʔΠεΧ΢τϧʔϧ
    - YAGNIɹ
    - KISSɹ
    - ୯Ұ੹೚ݪଇ
    - ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ
    ಋೖͱݪଇ > ݪଇ

    View full-size slide

  16. ϘʔΠεΧ΢τϧʔϧ
    Try to leave this world a little better than you found it...
    — Robert Baden-Powell
    Robert C. Martin ͕ιϑτ΢ΣΞ։ൃʹద༻1
    ίʔυʹมߋΛՃ͑Δͱ͖ɺվળΛࢪ͢
    1 97 Things Every Programmer Should Know: Collective Wisdom from the Experts, Kevlin Henney, 2010
    ಋೖͱݪଇ > ݪଇ > ϘʔΠεΧ΢τϧʔϧ

    View full-size slide

  17. ϘʔΠεΧ΢τϧʔϧͰ͢΂͖͜ͱ 1/2
    - ௥Ճ: ίϝϯτ, ςετ
    - ࡟আ: ෆཁͳґଘؔ܎, ϝϯό, ঢ়ଶ
    - ໊લͷมߋ: Ϋϥε, ؔ਺, ม਺
    - ෼ׂ: ڊେͳΫϥε, ؔ਺, ωετ, ݺͼग़ؔ͠܎
    - ߏ଄Խ: ϑΥʔϚοτ, ґଘؔ܎, ந৅ԽϨΠϠ, ܧঝ֊૚
    ಋೖͱݪଇ > ݪଇ > ϘʔΠεΧ΢τϧʔϧ

    View full-size slide

  18. ϘʔΠεΧ΢τϧʔϧͰ͢΂͖͜ͱ 2/2
    ίʔυΛѱԽͤ͞ͳ͍ (ׂΕ૭ཧ࿦)
    ྫ: ڊେͳߏ଄ʹཁૉΛ௥Ճ͢΂͖Ͱͳ͍
    - ڊେͳΫϥεɾؔ਺ʹ ϝϯόɾจ Λ௥Ճ͠ͳ͍
    - ਂ͍ݺͼग़͠ߏ଄ɾܧঝؔ܎ʹ ֊૚ Λ௥Ճ͠ͳ͍
    ಋೖͱݪଇ > ݪଇ > ϘʔΠεΧ΢τϧʔϧ

    View full-size slide

  19. ϘʔΠεΧ΢τϧʔϧͷద༻ྫ 1/3
    ໰୊: ৽͍͠ ViewType ͱͯ͠ Z Λ௥Ճͯ͠Α͍ʁ
    val viewType: ViewType = ... // An enum type
    when (viewType) {
    A -> {
    view1.isVisible = true
    view2.text = "Case A"
    }
    B -> {
    view1.isVisible = false
    view2.text = "Case B"
    }
    ...
    ಋೖͱݪଇ > ݪଇ > ϘʔΠεΧ΢τϧʔϧ

    View full-size slide

  20. ϘʔΠεΧ΢τϧʔϧͷద༻ྫ 2/3
    ղ౴: ʮͦͷ··Ͱ͸ʯ௥Ճͯ͠͸͍͚ͳ͍
    ͢Ͱʹ৚݅෼ذͷߏ଄͕ංେԽ͍ͯ͠ΔͨΊ
    ղܾҊ: ஋ΛྻڍܕͷϓϩύςΟͱͯ͠நग़
    ಋೖͱݪଇ > ݪଇ > ϘʔΠεΧ΢τϧʔϧ

    View full-size slide

  21. ϘʔΠεΧ΢τϧʔϧͷద༻ྫ 3/3
    1: ϓϩύςΟͱͯ͠ நग़͢Δ
    enum class ViewType(val isView1Visible: Boolean, val view2Text: String)
    2: ϓϩύςΟΛ࢖ͬͯ ৚݅෼ذΛ࡟আ͢Δ
    view1.isVisible = viewType.isView1Visible
    view2.text = viewType.view2Text
    3: ৽͍͠λΠϓ Z Λ௥Ճ͢Δ
    ಋೖͱݪଇ > ݪଇ > ϘʔΠεΧ΢τϧʔϧ

    View full-size slide

  22. ϘʔΠεΧ΢τϧʔϧͷ஫ҙ఺
    ϓϧϦΫΤετ΍ίϛοτΛංେԽͤ͞ͳ͍
    - ࣮૷ͷʮલʹʯϦϑΝΫλϦϯά
    ӨڹൣғΛߟ͑Δ
    - ϦϑΝΫλϦϯάൣғΛ͋Β͔͡ΊܾΊ͓ͯ͘
    - ϦϦʔεϒϥϯνͰ͸ϦϑΝΫλϦϯά͠ͳ͍
    ಋೖͱݪଇ > ݪଇ > ϘʔΠεΧ΢τϧʔϧ

    View full-size slide

  23. ࠓճͷ಺༰
    - ಋೖ
    - ϘʔΠεΧ΢τϧʔϧ
    - YAGNIɹ
    - KISSɹ
    - ୯Ұ੹೚ݪଇ
    - ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ
    ಋೖͱݪଇ > ݪଇ

    View full-size slide

  24. YAGNI
    You Aren't Gonna Need It
    ඞཁͳͱ͖͚࣮ͩ૷͢Δ
    - ʮকདྷͷͨΊʯͷػೳͷ 90% ͸࢖ΘΕͳ͍ 2
    - ߏ଄Λ୯७ʹอͭ = ࢓༷มߋʹରԠ͠΍͍͢ 2
    2 http://www.extremeprogramming.org/rules/early.html
    ಋೖͱݪଇ > ݪଇ > YAGNI

    View full-size slide

  25. YAGNI ʹҧ൓͍ͯ͠Δίʔυ
    ࢖ΘΕ͍ͯͳ͍ίʔυ
    - ࢀর͞Ε͍ͯͳ͍Ϋϥεɾؔ਺ɾม਺
    - ίϝϯτΞ΢τ͞Εͨίʔυ
    ա౓ʹ֦ு͞Εͨίʔυ
    - ࢠΫϥε͕͚̍ͭͩͷந৅Ϋϥε
    - ఆ਺͔͠౉͞Εͳ͍Ҿ਺
    ಋೖͱݪଇ > ݪଇ > YAGNI

    View full-size slide

  26. YAGNI ʹҧ൓͍ͯ͠Δྫ
    UI ཁૉͷ࠲ඪΫϥεʹʮ୯ҐʯΛ௥Ճ͢Δ
    class Coordinate(val x: Int, val y: Int, val unitType: UnitType)
    enum class UnitType { PIXEL, POINT }
    Coordinate + Coordinate Λఆٛ͠Α͏ͱ͢Δͱෳࡶʹ
    ࢖ΘΕ͍ͯͳ͍ػೳͷ࣮૷͸ؒҧͬͨઃܭΛҾ͖ى͜͠΍͍͢
    ಋೖͱݪଇ > ݪଇ > YAGNI

    View full-size slide

  27. YAGNI ͷ஫ҙ఺
    ػೳͷ࣮૷͕য఺
    - ઃܭ΍ػೳͷཁ൱ͷٞ࿦͸ԣணͯ͠͸͍͚ͳ͍
    ίʔυͷมߋՄೳੑ͕લఏ
    - ֎෦ެ։͢Δ APIɾϥΠϒϥϦ౳͸ཁݕ౼
    - όʔδϣϯʹΑΔߋ৽खஈ͕ඞཁ
    ಋೖͱݪଇ > ݪଇ > YAGNI

    View full-size slide

  28. ࠓճͷ಺༰
    - ಋೖ
    - ϘʔΠεΧ΢τϧʔϧ
    - YAGNIɹ
    - KISSɹ
    - ୯Ұ੹೚ݪଇ
    - ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ
    ಋೖͱݪଇ > ݪଇ

    View full-size slide

  29. KISS
    Keep It Simple Stupid
    — Clarence Leonard "Kelly" Johnson
    ୯७ͳํ๏ΛબͿ
    - ՄೳͳݶΓඪ४ͷ࣮૷Λ࢖͏
    - ϥΠϒϥϦɾϑϨʔϜϫʔΫɾσβΠϯͷ༻్ΛߜΔ
    ඒ͍͠ɾ༏խͳίʔυ͕ಡΈ΍͍͢ͱ͸ݶΒͳ͍
    ಋೖͱݪଇ > ݪଇ > KISS

    View full-size slide

  30. KISS: Α͘ͳ͍ྫ
    return userActionLog
    .groupBy { it.user }
    .map { it.key to it.value.size }
    .sortedBy { it.second }
    .map { it.first }
    .takeLast(10)
    Ϩγʔό΍ it ͕Կ͔͸ ͢΂ͯಡ·ͳ͍ͱཧղ͕Ͱ͖ͳ͍
    ಋೖͱݪଇ > ݪଇ > KISS

    View full-size slide

  31. KISS: Α͘ͳ͍ྫ
    return userActionLog
    .groupBy ...
    .map ...
    .sortedBy ...
    .map ...
    .takeLast(10)
    Ϩγʔό΍ it ͕Կ͔͸ ͢΂ͯಡ·ͳ͍ͱཧղ͕Ͱ͖ͳ͍
    ಋೖͱݪଇ > ݪଇ > KISS

    View full-size slide

  32. KISS: Α͍ྫ
    val logCountByUser: Map = userActionLog
    .groupBy { log -> log.user }
    .map { (user, logs) -> user to logs.size }
    val userListSortedByLogCount: List = logCountByUser
    .sortedBy { (_, messageCount) -> messageCount }
    .map { (userId, _) -> userId }
    return userListSortedByLogCount.takeLast(10)
    ඒ͘͠͸ͳ͍͕ɺཧղ͠΍͍͢
    ಋೖͱݪଇ > ݪଇ > KISS

    View full-size slide

  33. KISS: Α͍ྫ
    val logCountByUser: Map = userActionLog
    ...
    ...
    val userListSortedByLogCount: List = logCountByUser
    ...
    ...
    return userListSortedByLogCount.takeLast(10)
    ඒ͘͠͸ͳ͍͕ɺཧղ͠΍͍͢
    ಋೖͱݪଇ > ݪଇ > KISS

    View full-size slide

  34. ࠓճͷ಺༰
    - ಋೖ
    - ϘʔΠεΧ΢τϧʔϧ
    - YAGNIɹ
    - KISSɹ
    - ୯Ұ੹೚ݪଇ
    - ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ
    ಋೖͱݪଇ > ݪଇ > ୯Ұ੹೚ݪଇ

    View full-size slide

  35. ୯Ұϝιου == ୯Ұ੹೚ʁ
    ϝιουͷ਺Ͱ͸੹೚͸ଌΕͳ͍
    class Alviss {
    // May show a text, may break the device, may launch a rocket,
    // may ...
    fun doEverything(state: UniverseState)
    }
    ಋೖͱݪଇ > ݪଇ > ୯Ұ੹೚ݪଇ

    View full-size slide

  36. ୯Ұ੹೚ݪଇ
    A class should have only one reason to change.
    — Robert C. Martin
    ̎ͭҎ্ͷػೳΛࠞͥͯ͸͍͚ͳ͍
    ಋೖͱݪଇ > ݪଇ > ୯Ұ੹೚ݪଇ

    View full-size slide

  37. ୯Ұ੹೚ݪଇ: Α͘ͳ͍ྫ 1/2
    ਤॻؗͷॻ੶ି͠ग़͠ঢ়ଶ
    ಋೖͱݪଇ > ݪଇ > ୯Ұ੹೚ݪଇ

    View full-size slide

  38. ୯Ұ੹೚ݪଇ: Α͘ͳ͍ྫ 2/2
    class LibraryBookRentalData(
    val bookIds: MutableList,
    val bookNames: MutableList,
    val bookIdToRenterNameMap: MutableMap,
    val bookIdToDueDateMap: MutableMap, ...
    ) {
    fun findRenterName(bookName: String): String?
    fun findDueDate(bookName: String): Date?
    ...
    ಋೖͱݪଇ > ݪଇ > ୯Ұ੹೚ݪଇ

    View full-size slide

  39. ୯Ұ੹೚ݪଇ: վળҊ 1/2
    ΫϥεΛΤϯςΟςΟ͝ͱʹ෼ׂ͢Δ
    ಋೖͱݪଇ > ݪଇ > ୯Ұ੹೚ݪଇ

    View full-size slide

  40. ୯Ұ੹೚ݪଇ: վળҊ 2/2
    data class BookData(val id: Int, val name: String, ...)
    data class UserData(val name: String, ...)
    class CirculationRecord(
    val onLoanBookEntries: MutableMap
    ) {
    data class Entry(val renter: UserData, val dueDate: Date)
    ಋೖͱݪଇ > ݪଇ > ୯Ұ੹೚ݪଇ

    View full-size slide

  41. ੹೚ͷ෼ׂ
    ΫϥεΛ෼ׂ͢Δ
    - ΤϯςΟςΟ͝ͱʹϞσϧΛ෼͚Δ
    - ϨΠϠ΍ίϯϙʔωϯτ͝ͱʹϩδοΫΛ෼͚Δ
    - ର৅ͷσʔλܕ͝ͱʹϢʔςΟϦςΟΛ෼͚Δ
    ಋೖͱݪଇ > ݪଇ > ୯Ұ੹೚ݪଇ

    View full-size slide

  42. ੹೚ൣғͷ֬ೝํ๏
    Ϋϥε͕͍ͯ͠Δ͜ͱΛྻڍ → ཁ໿Λॻ͘
    ෼ׂΛߟྀ͢΂͖ঢ়گ:
    - ཁ໿Λॻ͘ͷ͕೉͍͠
    - ໊લʹൺ΂ͯཁ໿͕ංେʹͳΔ
    ಋೖͱݪଇ > ݪଇ > ୯Ұ੹೚ݪଇ

    View full-size slide

  43. ࠓճͷ಺༰
    - ಋೖ
    - ϘʔΠεΧ΢τϧʔϧ
    - YAGNIɹ
    - KISSɹ
    - ୯Ұ੹೚ݪଇ
    - ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ
    ಋೖͱݪଇ > ݪଇ

    View full-size slide

  44. ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ 1/2
    We should forget about small efficiencies,
    say about 97% of the time:
    premature optimization is the root of all evil.
    — Structured Programming with go to Statements, Donald Knuth
    ಋೖͱݪଇ > ݪଇ > ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ

    View full-size slide

  45. ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ 2/2
    Α͍࠷దԽ: ίʔυΛ୯७ʹ͢Δ࠷దԽ
    Α͘ͳ͍࠷దԽ: ίʔυΛෳࡶʹ͢Δ࠷దԽ
    ಋೖͱݪଇ > ݪଇ > ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ

    View full-size slide

  46. Α͍࠷దԽͷྫ
    ࠷దԽલ:
    val data = arrayList.find { data -> data.key == expectedKey }
    ࠷దԽޙ:
    val data = hashMap[expectedKey]
    ίʔυΛ୯७ʹͭͭ͠ ܭࢉྔΛݮΒ͢
    ಋೖͱݪଇ > ݪଇ > ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ

    View full-size slide

  47. ίʔυΛෳࡶʹ͢Δ࠷దԽ 1/2
    Yet we should not pass up our opportunities in that critical 3%
    — Donald Knuth
    ಋೖͱݪଇ > ݪଇ > ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ

    View full-size slide

  48. ίʔυΛෳࡶʹ͢Δ࠷దԽ 1/2
    - ՄมΦϒδΣΫτͷ࠶ར༻
    - Πϯελϯεϓʔϧ
    - ஗ԆॳظԽ
    - Ωϟογϡ
    ϓϥοτϑΥʔϜͷαϙʔτ͔ϓϩϑΝΠϦϯά͕ඞཁ
    ಋೖͱݪଇ > ݪଇ > ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ

    View full-size slide

  49. ࠷దԽͷฐ֐
    ୯७Խͷ๦͛ʹͳΔ
    - ΦϓςΟϚΠβͷ΄͏͕ੑೳ͕Α͍͜ͱ΋
    Φʔόϔουίετ͕͔͔Δ
    - Ωϟογϡ: Ωϟογϡϛε཰ ΞΫηε࣌ؒ
    - ஗ԆॳظԽ: (ಉظతͳ) ΠϯελϯενΣοΫ
    ಋೖͱݪଇ > ݪଇ > ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ

    View full-size slide

  50. ࠷దԽͷલʹ
    ࠷దԽ͕ଥ౰͔࠶֬ೝ
    ෳࡶ͞ʹݟ߹͏Ձ஋͕͋Δ͔
    ϓϩϑΝΠϦϯάɾݟੵ΋ΓΛߦ͏
    ࠷దԽର৅ (ܭࢉྔ, ϝϞϦ)ɾ࡟ݮྔɾ࢖༻཰
    ಋೖͱݪଇ > ݪଇ > ࣌ظঘૣͳ࠷దԽ͸ॾѱͷࠜݯ

    View full-size slide

  51. ·ͱΊ
    ಡΈ΍͍͢ίʔυ: ੜ࢈ੑΛҡ࣋͢Δखஈ
    ϘʔΠεΧ΢τϧʔϧ: ίʔυมߋલΑΓಡΈ΍͘͢
    YAGNI: ඞཁʹͳͬͨͱ͖ʹॳΊ࣮ͯ૷
    KISS: ୯७ͳํ๏Λ࢖͏, ඒ͍͠ != ಡΈ΍͍͢
    ୯Ұ੹೚ݪଇ: ੹೚ൣғΛ໌֬ʹ
    ࣌ظঘૣͳ࠷దԽ: ࠷దԽͷલʹϓϩϑΝΠϦϯάɾݟੵ΋Γ
    ಋೖͱݪଇ > ·ͱΊ

    View full-size slide