A Philosophy of Software Design ãèªãã
æ¬ã«ã€ããŠ
å šç·šè±èªãªã®ã§ãããããªãèªã¿ãããè±èªã§èšèŒãããŠãããšæããŸããã
ãšã«ããã¢ãžã¥ãŒã«ãšããã®ã¯æ å ±ãæœè±¡åããé èœããŠããæå³ããããšããã¹ã¿ã³ã¹ã§ãããããæ·±ãã¢ãžã¥ãŒã«ããšåœåããŠããã®ããŠããŒã¯ã§ããã
åºæ¬çã«ããããèšèšé¢é£ã®æè¡æžã¯Notionäžã§ã¡ã¢ããšããªããèªãããšãå€ãã®ã§ããã£ãããªããã®ã¡ã¢ãããã°ã«ãæ®ããŠããããšæããåç« ã®ã¡ã¢ãæ®ããŠãããŸãã
ä»åŸãäœãããæè¡æžãèŠã€ãããåãããã«èšèŒããŠãããããªãŒãšæããŸãã
åç« ã®ã¡ã¢
Chapter 1 Introduction
ã·ã³ãã«ãªãã¶ã€ã³ããã倧ãããã¯ãã«ãªã·ã¹ãã æ§ç¯ãå¯èœã«ãããšèšã£ãŠããã
ãã®æ¬ã§ã¯ 2 ã€ã®ã¢ãããŒãã説æããŠããŠ
- ã³ãŒããã·ã³ãã«ã«ãããæããã«ããããšã§è€éæ§ãæžããã¢ãããŒã
- è€éæ§ãå±æåãããšããã¢ãããŒã
- ãªããžã§ã¯ãæåãªã©
- ãã®æ¬ã§ã¯ modular design ãšåŒã°ããŠãã
ç¶ç¶çãªéçºãšã¯ã€ãŸãç¶ç¶çãªåèšèšãæå³ããŠãã
ãŸãè€éæ§ãšã¯ãªã«ãïŒãè¿°ã¹ãäžã§ãããããæå°åããéçºã®ã¢ãããŒããè¿°ã¹ã
Chapter 2 The Nature of Complexity è€éæ§ã®å®çŸ©
ã·ã¹ãã ãç解ãå€æŽããããšãé£ãããªã£ãæ§é ã®ããšãè€éæ§ãšè¿°ã¹ãŠããã
è€éæ§ã Isolating (å€ç«) ãããããšã§ãå šäœçãªè€éæ§ãæžããããšãã§ãã
ã³ãŒããèªãåŽã®äººéãè€éã ãšæã£ããããã¯è€éã§ãã
è€éæ§ã®çç¶ãšã㊠3 ã€ãäžããŠãã
- Change Amplification: å€æŽç®æãå€ããšããããš
- å€æŽç®æãè€æ°ã«ãŸããã£ãŠãã
- Cognitive Load: èªç¥è² è·
- ã°ããŒãã«å€æ°ãäžè²«æ§ã®æ¬ åŠãã¢ãžã¥ãŒã«éã®äŸåé¢ä¿ãªã©
- Unknowns unknown: åãããªãããšãåãããªã
- ãããäžçªæªããšè¿°ã¹ãŠãã
- ç¥ããªããšãããªãããšã®ã«ãããç¥ããã¹ããªãç¶æ
- ããèšèšã®éèŠãªãŽãŒã«ã«ãæããããããã
è€éæ§ã¯äŸåæ§ãšãããŸããã® 2 ã€ã«ãã£ãŠåŒãèµ·ãããã
è€éæ§ã¯åŸã ã«çãŸããŠããã®ã§ããããçã¿åºããªãããã«ããã¡ã³ã¿ãªãã£ãå¿ èŠ
Chapter3 Working Code Isn't Enough åãã³ãŒãã§ã¯äžåå
Strategic Programming ãš Tactical Programming ã®å¯Ÿæ¯
- Tactical
- å¯èœãªéãçŽ æ©ãåããã®ãäœã
- strategic
- è¯ãèšèšãæ±ããŠæéãæè³ãã
- strategic ããããšçè
ã¯è¿°ã¹ãŠãã
- ãœãããŠã§ã¢ã¯é·ãæéçåãããã
ãããã財æ¿çãªè² åµãšéããæè¡çè² åµã¯å®å šã«è¿æžãããããšã¯ãªããšè¿°ã¹ãŠããããªã®ã§è¿æžãç¶ãã ãšããããšãèšã£ãŠãã
Chapter4 Modules Should Be Deep ã¢ãžã¥ãŒã«ã¯æ·±ãããã¹ã
- ãœãããŠã§ã¢ã®è€éæ§ãå¶åŸ¡ãã 1 ã€ã« modular design ããããããã¯éçºè
ãåãåããªããšãããªãè€éæ§ãã§ããã ãæå°åããã¢ãããŒãã
- ãã® modular design ã®ãŽãŒã«ã¯ãã¢ãžã¥ãŒã«éã®äŸåé¢ä¿ãæå°åããããšã«ãããããã¢ãžã¥ãŒã«ã¯ãå®è£ ãããã€ã³ã¿ãŒãã§ãŒã¹ãã·ã³ãã«ã«ãªã£ãŠããããšã
- ã·ã³ãã«ãªã€ã³ã¿ãŒãã§ãŒã¹ã§å±
åãªæ©èœãæäŸããã¢ãžã¥ãŒã«ã deep ïŒæ·±ãïŒãšçè
ã¯åŒã¶ã
- ã€ãŸãçãã€ã³ã¿ãŒãã§ãŒã¹ã§æ©èœçã«æ¯ãèãã¡ãœããããããšèšã£ãŠãããåºãã€ã³ã¿ãŒãã§ãŒã¹ã§å€§ããããšãããªãã¢ãžã¥ãŒã«ã¯è€éæ§ãé èœã§ããŠããªããïŒãã£ã¡ã¯ shallow ãšåŒã°ããŠããããïŒ
- Unix I/O ã GC ããdeep module ã®ä»£è¡šäŸã«äžããŠãããå€ãã®åé¡ãè€éãªåé¡ã I/F ãä»ããŠãããã㯠I/F ãããé èœããŠå®è¡ããŠãã
- LinkedList ã shallow module ã®ä»£è¡šäŸãè€éæ§ãé èœã§ããŠããªã
- ããããããŒã¿æ§é ããã®ãŸãŸãããã³ã°ããŠããã ã ãšããããšã ãã
- Classitis ãšããèšèã«ã€ããŠ
- ã¡ãœãããã¯ã©ã¹ã¯å°ããäœããšããæããããã®ã§ããããããã¡ã§ããã®ç¶æ ã Classitis ãšçè ã¯åŒã¶
- 確ãã« 1 〠1 ã€ã®ã¯ã©ã¹ãé¢æ°ã¯å°ãããªãããå
šäœçãªè€éæ§ã¯é èœã§ããŠããªãããããè€éæ§ãå¢ãã
- å°ããã¯ã©ã¹ã¯ãããæ©èœçã«æ¯ãèãããšã«ã¯è²¢ç®ããªã
- çè
ã¯ã¡ã«ããºã ãç¥ããªããŠãå¹æçã«äœ¿ãã ãšããããšãéèŠèŠããŠãããããããç¥ããªããšãªã«ãäžéœåãçããããšã«ç°ãå±ããŠããæããã
- ã¢ãžã¥ãŒã«ãå°å ¥ãããšããŠããæ å ±ã®æœè±¡åºŠãå€ãã£ãŠããªãå Žåã¯ãããè€éæ§ãäžãããšããã¹ã¿ã³ã¹ããªã®ã§ deep ãªã¢ãžã¥ãŒã«ããããšè¿°ã¹ãŠãã
5 ç« Information Hiding æ å ±é èœ
- ç¥èãã¢ãžã¥ãŒã«ã®å®è£ ã«åã蟌ãŸããŠããŠãã€ãããã€ã³ã¿ãŒãã§ãŒã¹ã«ã¯è¡šåºããŠããªãç¶æ ãç®æã
- æ°ããã¢ãžã¥ãŒã«ãèšèšãããšãã¯æ å ±ïŒç¥èïŒããã®ã¢ãžã¥ãŒã«å ã«é èœãããŠããã泚ææ·±ãèããã¹ã
- æç³»åã§æ±ãããããŒã¿ãè€æ°ã®ã¯ã©ã¹ã«åæ£ãããããšã¯ããã®ç¥èãã¯ã©ã¹éã§å
±æããŠããããšã«ãªãã奜ãŸãããªããšããã¹ã¿ã³ã¹ãããã temporal decomposition ãšè¿°ã¹ãŠãã
- äŸãã° HTTP ãµãŒã㯠temporal decomposition ã®äŸ
- ãªã¯ãšã¹ãããããŒã®ããŒã¹ãã¬ã¹ãã³ã¹ããããŒã®æ§ç¯ã¯æç³»åã«ããã€ã¬ã¹ãã³ã¹ããããŒã¯ãªã¯ãšã¹ãããããŒã«äŸåããŠãããããã®ã§ãã¯ã©ã¹èšèšãšããŠåããã¹ãã§ã¯ãªããšè¿°ã¹ãŠãã
- ãã®ææ³ã§äœãããã¢ãžã¥ãŒã«ã¯èªç¶ãšãæ·±ããã¢ãžã¥ãŒã«ã«ãªã£ãŠããã®ã§ãdeep module ã®ã²ãšã€ã®æ段ãèãæ¹ãæ
å ±é èœïŒinformation hiding) ã§ãã
- ã¯ã©ã¹ããã倧ãããã®ã«ããããšã§æ å ±é èœã¯ããéæããã
- ã¯ã©ã¹ãå°ãããåå¥ã«åãããšããã¹ã¿ã³ã¹ã«çã£åããç°è°ãå±ããŠããæãããã
6 ç« General-Purpose Modules are Deeper æ±çšçãªã¢ãžã¥ãŒã«ã¯æ·±ã
- é床ã«ç¹å¥ãªã±ãŒã¹ïŒãšããžã±ãŒã¹ïŒãªã©ã¯ãœãããŠã§ã¢ãè€éåãããã²ãšã€ã®èŠå
- general purpose(æ±çšçãªã¢ãžã¥ãŒã«) ã¯ããã·ã³ãã«ã§ç解ããããšã容æãšãªã
- ç¹å¥ãªã±ãŒã¹ãåŒãèµ·ããåé¡ãšæ±çšæ§ã®å©ç¹ã話ã
- ç¹æ®ã±ãŒã¹ã¯å®å šã«åãé€ããªãã®ã§ãã©ãåãããã«ã€ããŠã話ã
- ããäžè¬çãªã¢ãžã¥ãŒã«ãè¿œãã¹ã¿ã³ã¹ã¯ã è² åµè§£æ¶ãžã®æè³ã®ãã€ã³ãã»ããã«è¿ã
- å
ã
çè
ã YAGNI ã§ããã®ã§ã¯ãšããèãæ¹ã ã£ãããããã€ãã®åŠçã®ãããžã§ã¯ããèŠãŠãã©ã®å Žåã«ãããŠã general-purpose ãªã¯ã©ã¹ã®ã»ããããã£ããšããããšã«æ°ã¥ãã
- ããã¯ããšããã®ã¯ã©ã¹ãåå©çšãããªãã£ããšããŠã
- å
ã
çè
ã YAGNI ã§ããã®ã§ã¯ãšããèãæ¹ã ã£ãããããã€ãã®åŠçã®ãããžã§ã¯ããèŠãŠãã©ã®å Žåã«ãããŠã general-purpose ãªã¯ã©ã¹ã®ã»ããããã£ããšããããšã«æ°ã¥ãã
- çµéšãšããŠã
somewhat general-purpose
ãããå¡©æ¢ ã ãšèšã£ãŠããŠãã€ã³ã¿ãŒãã§ãŒã¹ã¯ããäžè¬çã§ããããšãç®æãã€ã€å®è£ 㯠YAGNI çã«å®è£ ãããšãããã®- ä»æ¬²ãããã®ãå®è£ ã¯ããããã€ã³ã¿ãŒãã§ãŒã¹ã¯äžè¬çãªãã®ãç®æããŠèšèšãé²ãã
- ããäžè¬çãªãŠãŒã¹ã±ãŒã¹ã§å©çšã§ããã¡ãœãããå®è£
ããããšã§ãå®è£
éã¯æžãããèªç¥è² è·ãäžããããšãã§ãã
- çµå±ãããæœè±¡åºŠãäžããã€ã³ã¿ãŒãã§ãŒã¹ãçšæããããšã§è§£æ±ºããã¢ãããŒã
- ããã£ãŠ information hiding(5 ç« ã®ãã€) ã ãããšãã話
- äŸãã°ããã¹ããšãã£ã¿ãŒã®å®è£
ã§ãbackspace ã®æåãå®è£
ãããæã«ããã®ãŸãŸ
backspace
ãšããã¡ãœãããçãããŠããããã£ãŠæ å ±ã®æœè±¡åãã§ããŠããªãã§ãããïŒãšãã話ãããŠãã- backspace ãæŒãããæã®æåãšããããšã¯ããããããããããã£ãŠã©ãããåŠçãããŠããã§ããïŒãšããã®ãã¡ãœããã·ã°ããã£ããããããªãã®ã§çµå±å®è£ ãèŠãå¿ èŠããããããšãã
- ä»ã®å¿
èŠãªãã®å
šãŠãã«ããŒã§ããæãã·ã³ãã«ãªã€ã³ã¿ãŒãã§ãŒã¹ã¯äœãïŒãåãç¶ããããšãéèŠ
- Questions to ask yourself
- æ®éçã«æ±ããªããïŒãšãã芳ç¹ã§èæ
®ãèšèšã«åæ ãããããšã§ç¹å¥æ±ãããªããšãããªãã±ãŒã¹ãæžããããšãã§ãã
- if æãæžãããããªã¢ãããŒããæ€èšããã
7 ç« Different Layer, Different Abstraction ç°ãªãã¬ã€ã€ãŒãç°ãªãæœè±¡å
- 䌌ããããªæœè±¡åãé£æ¥ããã¬ã€ã€ãè¡ããšããã¹ã¹ã«ãŒã¡ãœãããšãã圢ã§åé¡ãè¡šåºãã
- å®éã«ã¯äœãããªããã¹ã¹ã«ãŒã¡ãœããã¯ã綺éºãªè²¬åã®åå²ãã§ããŠããªãããšã瀺ãããšãå€ããã©ããã責ååå²ãªã®ãæ··ä¹±ãæããã¯ã©ã¹éã®äŸåãçã
- ããã¯ã¯ã©ã¹ããæµ ãããã
- åãã€ã³ã¿ãŒãã§ãŒã¹ã§ãããäŸãšã㊠Dispatcher ãæããŠãã
- ã©ã®ã¡ãœããã«ãã£ã¹ãããããããéžæãã Dispatcher ãšãã®å®éã®åŠçãšãªãã¡ãœããã¯åãã€ã³ã¿ãŒãã§ãŒã¹ïŒã·ã°ããã£ïŒãæã€å¯èœæ§ããã
- ããã¯æäŸããŠããæ©èœãæœè±¡åã®ã¬ã€ã€ãç°ãªãããèš±ãããã±ãŒã¹
- Decorator ã«ã¯åŠå®çãªç«å Žããšã£ãŠãã
- ç¹æ®ãªã±ãŒã¹ãèæ
®ããæµ
ãã¯ã©ã¹ãã¢ãžã¥ãŒã«ããã¹ã¹ã«ãŒã¡ãœããã倧éã«äœãããããšã«ãªããããã¯åç« ã§è¿°ã¹ãå
容ãšçžåããŠãã
- ãã³ã¬ãŒã¿ã¯å°å ¥ãããšé ·äœ¿ããããããšããããšãè¿°ã¹ãŠãããããã
- ãã³ã¬ãŒã¿ã®çµ±åãããããããã³ã¬ãŒã¿ã䜿ããªãã¯ã©ã¹ãèŠã€ãããªã©ã®ææ³ãææ¡ããŠãã
- ç¹æ®ãªã±ãŒã¹ãèæ
®ããæµ
ãã¯ã©ã¹ãã¢ãžã¥ãŒã«ããã¹ã¹ã«ãŒã¡ãœããã倧éã«äœãããããšã«ãªããããã¯åç« ã§è¿°ã¹ãå
容ãšçžåããŠãã
8 ç« Pull Complexity Downwards è€éæ§ãåŒã蟌ã
- ã¢ãžã¥ãŒã«ã¯éçºè
ãã䜿ã人ã®æ¹ãå€ãã®ã§ãå®è£
ãè€éã«ãªã£ããšããŠã䜿ã人ã«ãšã£ãŠã€ã³ã¿ãŒãã§ãŒã¹ãã·ã³ãã«ãªæ¹ããããšè¿°ã¹ãŠãã
- äŸå€ãèšå®(Config)ã«ã€ããŠãã€ã³ã¿ãŒãã§ãŒã¹ãå€éšã«å ¬éããŠããã®ã§è€éæ§ãäžããèŠå ãšèšã£ãŠãã
- configuration parameterïŒèšå®ãã©ã¡ãŒã¿ïŒ ãæ£ããå€ã«èšå®ããããšã¯é£ãããããã¯äžå¯èœãšè¿°ã¹ãŠãã
- ããã«èšå®é ç®ãå€éšã«å ¬éããåã«ããæ£ããããã©ã«ãå€ãæã ïŒæäŸåŽïŒã«èšå®ã§ããªããããåãã¹ã
- èšå®ãã©ã¡ãŒã¿ã¯äžå®å
šãªãœãªã¥ãŒã·ã§ã³ãæäŸããŠãããšè¿°ã¹ãŠãã
- ããããã®ã¢ãžã¥ãŒã«ã¯åã ã§åé¡ã解決ãã¹ã
9 ç« Better Together Or Better Apart? äžç·ã«ããã¹ããåããã¹ãã
- 现ååã®ããããã¯è¯ããªã
- ã³ã³ããŒãã³ããã€ã³ã¿ãŒãã§ãŒã¹ã®æ°ãå¢ããããšã«ãªããããã¯è€éæ§ããã
- 现ååããã³ã³ããŒãã³ãããªãŒã±ã¹ãã¬ãŒã·ã§ã³ããå±€ãå¿ èŠã«ãªã
- åæãçã
- å®å šã«åé¢ãããŠãããªãè¯ã
- äŸåããããšã³ã³ããŒãã³ãéãè¡ã£ããæ¥ããããå¿ èŠãåºãŠããã®ã§è¯ããªã
- è€è£œãçã
- é¢ä¿ã®ãªããã®ã¯åããŠãé¢é£ãããã®ã¯äžç·ã«æ±ã£ãæ¹ããããšããŠãã
- é¢é£ããŠããããšã瀺ããã®
- æ
å ±ãå
±æããŠãã
- ããŒã¿ãèªãã§ãããŒã¹ããŠãã®ãããªåŠçã¯ããŒã¿ãèªããšãããšããŒã¹ãããšããã§åãç¥èãå
±æããŠãã
- HTTP ãµãŒãã®äŸãªã©
- ããŒã¿ãèªãã§ãããŒã¹ããŠãã®ãããªåŠçã¯ããŒã¿ãèªããšãããšããŒã¹ãããšããã§åãç¥èãå
±æããŠãã
- äžç·ã«äœ¿ããã
- æŠå¿µãéãªã£ãŠãã
- ä»ã®ç®æãèŠãªããšç解ãé£ãã
- æ
å ±ãå
±æããŠãã
- é¢é£ããŠããããšã瀺ããã®
- ã¡ãœããã®åå²ã®åºæºãšããŠè¡æ°ãæ¡çšããããšã«å察ããŠãã
- ã¡ãœããåå²ãããããã ããšè¿°ã¹ãŠãã
- ã·ã³ãã«ãªã¡ãœããã·ã°ããã£ã§èªãããšãç°¡åãªã®ã§ããã°åããå¿
èŠããªã
- ãã㯠âdeepâ ãªã¡ãœãã
- ã¡ãœãããåããããšã§è¡ãæ¥ãå¢ããã¡ãœããã®ã€ã³ã¿ãŒãã§ãŒã¹ãå¢ããè€éæ§ãå¢ã
- ã¡ãœãããèšèšããéã®ãŽãŒã«ã¯ãæœè±¡ããæäŸããããš
- ã¡ãœããéãè¡ãæ¥ããããšã¯æœè±¡ãæäŸã§ããŠããããred flag ã ãšè¿°ã¹ãŠãã
- ã¡ãœããã«åãåºããšããããšã¯ãã®å ã§å ·äœçã«äœãããŠããããç¥ããªããŠããããããã«ãªã£ãŠããã¯ã
10 ç« Define Errors Out Of Existence ååšããªãããã«ãšã©ãŒãå®çŸ©ãã
- äŸå€ã¯ã¯ã©ã¹ãæã€ã€ã³ã¿ãŒãã§ãŒã¹ã®äžéšã§ãã
- å€ãã®äŸå€ã¯ã¯ã©ã¹ã âshallowâ ã«ããŠãè€éãªã€ã³ã¿ãŒãã§ãŒã¹ãšãªã
- äŸå€ãæããããšã¯ç°¡åã ãããããåãåã£ãŠãã³ããªã³ã°ããåŽã¯é£ãã
- ããªãã¡åŒã³åºãåŽã§ãã³ããªã³ã°ããªããã°ãªããªãäŸå€ãæžããããšãéèŠ
- ãªããªããã³ããªã³ã°ãå¿
èŠãªäŸå€ããªããããšãäžçªãããšèšã£ãŠãã
- ã»ãã³ãã£ã¯ã¹ãåå®çŸ©ããããšã§äŸå€ãæžããããšãã§ãã
- Java ã®æååã®ã¡ãœããã®è©±
- äŸå€ããã¹ã¯ãã
- äŸå€ãæãããšããã§ãããåãããŠãŒã¶ã«ã¯ã©ããããã解決ãã§ããªãããšããã
- ãã¡ã€ã«ã·ã¹ãã ãµãŒãã®ãšã©ãŒãªã©
- ã©ãã埩æ§ããã¿ã€ãã³ã°ã§ãªãã©ã€ãããã ãããäŸå€ã¯åããã«ãã³ã°ãããŠããããŸãŸã«ããã®ãåçç
- äŸå€ãæãããã£ããã¯ã©ã€ã¢ã³ãåŽã§ã¿ã€ã ã¢ãŠããèšå®ããŠæåã§ãšã©ãŒãæããã°ãã
- ããã©ã«ãã¯äžçªäœ¿ãåæãããç¶æ ã«ããã¹ããšããææ³ãããã«ãçŸããŠãã
- äŸå€ãæãããšããã§ãããåãããŠãŒã¶ã«ã¯ã©ããããã解決ãã§ããªãããšããã
- ã»ãã³ãã£ã¯ã¹ãåå®çŸ©ããããšã§äŸå€ãæžããããšãã§ãã
- äœãéèŠã§äœãéèŠã§ãªãããèŠæ¥µããããšãå¿
èŠ
- éèŠã§ãªããšã©ãŒã¯é ãããã¹ãã ãéèŠãªãšã©ãŒã¯å€éšã«éç¥ã§ããããã«ãªã£ãŠããã¹ã
- çºçé »åºŠãã¬ã¢ã ã£ããããªã«ããªäžå¯èœãªãšã©ãŒã®ãã³ããªã³ã°ã§è€éæ§ãäžããå¿ èŠã¯ãªã
- éèŠã§ãªããšã©ãŒã¯é ãããã¹ãã ãéèŠãªãšã©ãŒã¯å€éšã«éç¥ã§ããããã«ãªã£ãŠããã¹ã
11 ç« Design it Twice äºåºŠèšèšãã
- è²ã
ãªãã¿ãŒã³ããããªããèšèšæ¹éãèããã®ããã
- äžçªããèšèšã ãšæã£ãŠããŠãå¥ã®ãã¿ãŒã³ãèããpros/cons ãæŽçããããšã§ããããã¹ããªèšèšã«è¿ã¥ããšãã話
- ã€ã³ã¿ãŒãã§ãŒã¹ã¬ãã«ã®èšèšããããå®è£
ã¬ãã«ã§ãè€æ°ã®ãã¿ãŒã³ãæ€èšããã
- å®è£ ã¬ãã«ã®å Žå㯠ã·ã³ãã«ããšããã©ãŒãã³ã¹æ§ãéèŠãã
12 ç« Why Write Comments? The Four Excuses ãªãã³ã¡ã³ããæžãïŒ4 ã€ã®èšãèš³
- ã³ã¡ã³ããæžãããã»ã¹ã¯ãã·ã¹ãã ãžã®ç解ã ãã§ãªããèšèšãããåäžããããã®ã ãšèšã£ãŠãã
- 4 ã€ã®èšãèš³
- è¯ãã³ãŒãã¯ãããèŠãã°ãããïŒself-documenting)
- ã¯ã©ã¹ã€ã³ã¿ãŒãã§ãŒã¹ãã¡ãœããã·ã°ããã£ã¯ã³ãŒããèŠãã°ããã
- ããæœè±¡åºŠã®é«ããã¡ãœãããäœãããŠããããããçµæãè¿ãå€ã®æå³ãã«ã€ããŠã¯ã³ãŒãã§ãã説æããããšãã§ããªã
- èšèšäžã®ææ決å®ãç¹å®ã®ã¡ãœãããåŒã¶ã¹ãæ¡ä»¶ ãªã©ãã³ãŒãã§ãã説æã§ããªãäŸã¯ãããããã
- ãã³ãŒããèªãã°åããããšèšã£ãŠäžã€ã®ã¡ãœãããããã«åå²ããŠããããã«ãªããšããæµ ããã¢ãžã¥ãŒã«ãåºæ¥äžãã£ãŠãã
- ã³ã¡ã³ãã¯æœè±¡åãæäŸããããã¯ã¢ãžã¥ãŒã«åãç®æããã®ãšåãããšã
- ãã®ã¡ãœããã䜿ãæã³ãŒããèªãŸãªããšãããªãã®ã§ããã°ãããã¯äœãæœè±¡åããªããšããããšãè¡šããŠãã
- èªç¶èšèªã¯ãã®æœè±¡åã«äžåœ¹è²·ãããšãã§ãã
- ã³ã¡ã³ããæžãæéããªã
- ããã«å¯Ÿæããã«ã¯ãinvestment mindsetãé·æçãªæèãéèŠ
- ã³ã¡ã³ãã®èšèŒã¯å®è£ ã® 10%ãæéãããããªãããå©çã¯ããã«äº«åã§ãã
- ã³ã¡ã³ããè¿œåŸã§ããªããšãã¹ãªãŒãã£ã³ã°ã«ãªã
- 倧ããã³ã¡ã³ãã®ä¿®æ£ã¯å€§ããå®è£ ã®å€æŽã«äŒŽããã®ã§ãããã©ããã£ãŠãå®è£ ããã³ã¡ã³ãã®èšèŒã«æéããããããšã¯ãªãã®ã ãããããææ°ã®ã³ã¡ã³ãã«è¿œåŸãããã®ã¯ãããŸã§ã®åªåã¯å¿ èŠãšããªãã ãã
- èŠãããšãããã³ã¡ã³ãã«äŸ¡å€ãæããããšããªã
- ããããã¥ã¡ã³ããŒã·ã§ã³ãšã¡ã³ããã³ã¹ã®æ¹æ³ãç¥ãã°ãã
- è¯ãã³ãŒãã¯ãããèŠãã°ãããïŒself-documenting)
- ã³ãŒããšããŠæžãããšã®ããŒã¹ã®èãã¯ãã³ãŒãã§ã¯è¡šçŸã§ããªãèšèšè
ã®ãã€ã³ããèšèŒãã
- ããŒã¬ã€ã€ãŒã®ããªãããŒãªã¯ã»ã®ããã³ãŒãããããã€ã¬ã€ã€ãŒã®ã¯ã©ã¹èšèšãŸã§é©çšå¯èœ
13 ç« Comments Should Describe Things that Arenât Obvious from the Code ã³ã¡ã³ãã¯ã³ãŒãããæããã§ãªããã®ãæžãã¹ã
- éçºè
ã¯ãã³ãŒãèªããããå€éšã«å
¬éããã宣èšïŒã³ã¡ã³ãå«ããŠïŒããæŠèŠãç解ããã¹ã
- è¯ãã³ã¡ã³ãã¯ãã³ãŒããšå¥ã®ç²åºŠã§æœè±¡åãããŠããããšã ãšè¿°ã¹ãŠãã
- ã³ã¡ã³ãã«é¢ãã 4 ã€ã®ã«ããŽãªã«ã€ããŠ
- Interface
- ã¯ã©ã¹ã®æå³ãã¡ãœããã®æ¯ãèã
- å®è£
ãšã€ã³ã¿ãŒãã§ãŒã¹ãåããŠã³ã¡ã³ããšããŠæ®ãããã«çç®ãã
- æ®ããªãå Žåã¯ãæµ ããã¡ãœããã§ãã
- å¯äœçšã¯è¿ãå€ããã¯å€æã§ããªãã®ã§ã€ã³ã¿ãŒãã§ãŒã¹ã¬ãã«ã®ã³ã¡ã³ããšããŠæ®ã
- Data structure member
- ããŒã¿æ§é ã«é¢ãããã®
- Implementation comment
- å®è£ ã«é¢ãããã®
- å®è£
ã«é¢ããŠäœãããŠããããè¡šããã®ã§ã©ããã£ãŠãããã§ã¯ãªã
- how ã§ã¯ãªã what ãæžã
- ããªãããŒãªããšãããŠããå Žå㯠why ãæžã
- Cross-module comment
- äŸåããã¢ãžã¥ãŒã«ã«é¢ãããã®
- æåã® 2 ã€ãç¹ã«éèŠãšè¿°ã¹ãŠããããã¹ãŠã®ã¯ã©ã¹ãã¡ãœããã¯ã³ã¡ã³ããæã€ã¹ã
- ãã£ãšããã蟺ã¯ãdeepããªã¯ã©ã¹ãã¡ãœããã§ããããšãæã«åæã«ãªã£ãŠãããã ãã
- Interface
- ã³ãŒããèªãã ããšããªã人ããã³ã¡ã³ãã ãã§æžããããã«ãªããïŒãåããšãã
- ã¡ãœããåãå€æ°åãªã©ãšéãèªåœã䜿ã£ãŠã³ã¡ã³ãã§è£è¶³ãããšããã³ã¡ã³ãã®æåã®ã¹ãããã«ãªããšèšã£ãŠãã
- ã³ã¡ã³ãã¯åè©ã§ã¯ãªãåè©ã«å¯ŸããŠãã©ãŒã«ã¹ãããšåé·ãªã³ã¡ã³ãã«ãªãã®ãé¿ããããšãã§ãã
- ãã®ã³ãŒãã¯äœãããŠããã®ãïŒã³ãŒãã説æããã·ã³ãã«ãªèªåœã¯äœãïŒãã®ã³ãŒãã§æãéèŠãªããšã¯äœãïŒããããåããã³ã¡ã³ããšããŠæ®ãããšã§æœè±¡ãæŠèŠãæäŸããã³ã¡ã³ããæžãããšãã§ãã
- èªã¿æãææ§ã ãšæãããããã¯ææ§ãªã®ã§ãããããææã«å¯ŸããŠãã©ããææ§ããè°è«ããããšãæããŠã¯ãããªã
14 ç« Choosing Names åœå
- ããŸããŸãããªåœåã«çããŠã¯ãããªã
- æéããšã£ãŠãæ£ç¢ºã§ãææ§ãããªããçŽæçãªååãã€ããã¹ã
- åœåãæœè±¡åã®äžã€ã®åœ¢åŒã ãšèšã£ãŠãã
- åœåã«å°ããšããããšã¯ãå€æ°ã®å®çŸ©ãç®çãææ§ãšããããšãè¡šããŠãããèšèšã®åŒ±ã¿ãç¹å®ããåäžããããæ©äŒãšæããããšãã§ãã
- ãããäžè²«ããŠãããªãçãå€æ°åã§ãè¯ãããçãå€æ°ã¯ã³ã³ããªã¯ãããã¡ã§ãåãå€æ°ãç°ãªãã³ã³ããã¹ãã§äœ¿ããããªããããæ¹ããã
- i, j ã¯ã«ãŒãå€æ°ããšããããããã®ãªãè¯ã
15 ç« Write The Comments First æåã«ã³ã¡ã³ããæžã
- ã³ã¡ã³ããæžãã®ã«æé©ãªã¿ã€ãã³ã°ã¯ãã³ãŒããæžãå§ããæåã ãšè¿°ã¹ãŠãã
- åŸããã³ãŒããæžãããšãããšåŸåãã«ããçµæãæžããªããšããããšãèµ·ãããã¡
- ã³ã¡ã³ããæåã«æžãããšã®æ©æµã¯ 3 ã€
- èšèšã«é¢ããèšæ¶ããã¬ãã·ã¥ãªã®ã§ãå¿ããããšããªãããš
- å®è£ ã«éäžãããšèšèšã«é¢é£ããææ決å®ã®å 容ãå¿ããŠããŸãããšããã
- ã³ã¡ã³ããæåã«æžãããšã¯è¯ãèšèšãæäŸãã
- ã³ã¡ã³ããæžãè¡çºã«ãã£ãŠèªèº«ã«å¯Ÿããã¬ãã¥ãŒäœçšãåã
- å®è£ ã®åã«ã³ã¡ã³ããæžãããšã§ãããæœè±¡ãªäºæã察象ã«ããã³ã¡ã³ããæžãããšãã§ãããããããã³ã¡ã³ãã«ã€ãªãã
- ã³ã¡ã³ãã§è¡šçŸããå 容ããã¡ãããªå Žåã¯ãããŸã責ååå²ãã§ããŠããªãããšã瀺åããŠããããã
- ã³ã¡ã³ããæžãããšã楜ãã
- è¯ãèšèšã®ææšãšãªããããããã䜿ã£ãŠããã«èšèšã«é¢ããæ¢ç©¶ãã§ãããšããããšã§çè ã¯æ¥œãããšè¿°ã¹ãŠãã
- èšèšã«é¢ããèšæ¶ããã¬ãã·ã¥ãªã®ã§ãå¿ããããšããªãããš
16 ç« Modifying Existing Code æ¢åã³ãŒãã®æ¹ä¿®
- tactical ãš strategic ã®è©±ã§ãstrategic ã®ã¢ãããŒãããšãã¹ããšãã話ãåã³ç»å Žãã
- å®è£ ãšè¿ãäœçœ®ã«ã³ã¡ã³ããèšèŒããããšã§ãã³ã¡ã³ããå€æŽã«è¿œåŸãããªãåé¡ã解決ã§ãã
- ã³ããããã°ãŸã§èŠãããšã¯å°ãªãã®ã§ãã³ãããã§ã¯ãªããããã³ãŒãã³ã¡ã³ãã«æžããªãããåãã¹ã
- ã³ããããã°ã«ã¯ãªããã®å€æŽãå¿ èŠã ã£ãã®ãçã®èæ¯æ å ±ãèšèŒãããšãã
- ã³ã¡ã³ããéè€ããŠè€æ°ç®æã«èšèŒããããšãå¿ ãçæ¹ãè¿œåŸã§ããªããªãã®ã§é¿ããã¹ã
- ã³ãããããéã«ãå·®åãã»ã«ããã§ãã¯ããã³ã¡ã³ãã®ææ°åãæŒããŠããªããããã§ãã¯ãã
- ããããæœè±¡åºŠãé«ãã³ã¡ã³ãã§ããã°å®è£ ã®ãã³ã«é »ç¹ã«ä¿®æ£ããå¿ èŠããªããªãã®ã§ãããããã¢ãããŒããæ€èšããã
17 ç« Consistency äžè²«æ§
- äžè²«æ§ãé©çšã§ãããã®
- åœå
- ã³ãŒãã£ã³ã°ã¬ã€ã
- ã€ã³ã¿ãŒãã§ãŒã¹
- ãã¶ã€ã³ãã¿ãŒã³
- äžè²«æ§ã®ç¶æã«å¿
èŠãªèŠçŽ
- ããã¥ã¡ã³ã
- 匷å¶å
- éåãã§ãã¯ã®ããŒã«
- é·ã«å
¥ã£ãŠã¯é·ã«åŸã
- åšå²ã®ã³ãŒããèŠæž¡ããŠç解ãã
- æ¢åã®ã«ãŒã«ãå€æŽããªã
- better idea ã§ã¯ååã§ãªã
18 ç« Code Should be Obvious ã³ãŒãã¯æããã§ããã¹ã
- äžæçãã¯æ°ããéçºè
ã«ãšã£ãŠã·ã¹ãã ãæããã§ãªãæã«çãŸãã
- äžæçãã¯ã³ãŒãã®èªã¿æãå€æãããã®ãªã®ã§ãã³ãŒãã¬ãã¥ãŒããããå€æããããããã»ã¹ã«ãªã
- æçããå®çŸããããã«éèŠãªãã¯ããã¯ã¯ 2 ã€
- è¯ãåœå
- äžè²«æ§
19 ç« Software Trends
- ãªããžã§ã¯ãæåã«ã€ããŠ
- 芪ãšåã§äŸåé¢ä¿ãã§ãããããªå®è£ ã¯ãããã¹ã
- äŸãã°ã芪åŽã§ããã©ã«ãã®æ¯ãèããå®çŸ©ããŠããŠãåã¯ã©ã¹ã§ããããªãŒãã©ã€ããããããªãã£ããããã±ãŒã¹
- å ±æã§ããæ¯ãèã㯠composition ããŒã¹ãªã¢ãããŒããæ€èšããã
- ã¢ãžã£ã€ã«éçºã«ã€ããŠ
- 泚æãããã®ã¯ãtactical programming ã«åæããŠããŸãå¯èœæ§ãããããš
- åã ã®æ©èœå®è£ ã ã£ããã€ãã¬ãŒã·ã§ã³ã®æéå¶çŽã ã£ããã§ãçæçãªèŠéã«é¥ããã¡
- ã€ãã¬ãŒãã£ãã«ãæœè±¡ããããã®ãéçºããŠãã
- 泚æãããã®ã¯ãtactical programming ã«åæããŠããŸãå¯èœæ§ãããããš
- ãã¹ãé§åéçºã«ã€ããŠ
- ããã¹ããéãããšããæåªå ãšãªã£ãŠããã¹ããªèšèšãèŠã€ãããããªååŠãåããªããªãæžå¿µããããšè¿°ã¹ãŠãã
20 ç« Designing for Performance ããã©ãŒãã³ã¹ã®ããã®èšèš
- æ¢åã®ã³ãŒãäžã§ããã©ãŒãã³ã¹æ¹åãããå Žå
- ãŸãä»æ§ãæºããæå°éã®ã³ãŒããæžã
- ãã®éã«æ¢åã®ã³ãŒããã©ããªã£ãŠãããã¯æ°ã«ããªã
- ãã®æäœéã®ä»æ§ãæºããã³ãŒããšçŸåšã®ã³ãŒããšãçªãåãããŠãã®ã£ãããåããŠããããšããã
- ãšããžã±ãŒã¹ã®èæ ®çã§é ããªã£ãŠããå Žåãããã®ã§ãåé¢ã§ããªãããæ€èšãã
- ãŸãä»æ§ãæºããæå°éã®ã³ãŒããæžã