YAGNI

YAGNI (You aren't gonna need it) とは、エクストリーム・プログラミング(XP)から生まれた原則であり、「プログラマは、それが実際に必要となるまで機能を追加しない方が良い」というものである。直訳すると「あなたはそれを必要でなくなるだろう」、意訳すると「そんなの必要ないって」などという意味で、他の表現として"You aren't going to need it" (YAGTNI) や"You ain't gonna need it"というものもある。

XPの共同創設者であるロン・ジェフリーズ(英語版)は、「それが実際に必要になったときに実装するべきあって、必要になると予見したときに実装するべきでない」と述べている。ジョン・D・カーマックは、「将来の要件やアプリケーションを考慮して設計することが、トータルでプラスになることはほとんどないことを、経験の浅い開発者が理解するのは難しい」と書いている。

YAGNIは、XPのプラクティスである"do the simplest thing that could possibly work"(DTSTTCPW、うまくいく方法のうち最もシンプルなものでやれ)の背後にある原則である。これは、継続的リファクタリング、継続的自動単体試験、継続的インテグレーションなど、いくつかの他のプラクティスと組み合わせて使用されることを意図している。YAGNIが他のプラクティスのサポートに依存しているのは、XPの本来の定義の一部である。

理由

YAGNI原則を提唱する人々は、その理由として以下を挙げている。

脚注

  1. 1 2 Object-oriented & classical software engineering, Schach, Stephen R. (2007). 618 pages, p., webpage: Book-Google-hWwh, quote: "Two acronyms now associated with extreme programming are YAGNI (you aren't gonna need it) and DTSTTCPW (do the simplest thing that could possibly work)."
  2. ↑ Extreme Programming Installed, Jeffries, Ronald E.; Ann Anderson, Chet Hendrickson (2001). 265 pages, p. 190, webpage: Books-Google-dIsC, quote: "YAGNI: 'You Aren't Gonna Need It.' This slogan, one of XP's most famous..., reminds us always to work on the story we have, not something we think we're going to need."
  3. 1 2 Extreme Programming examined, Succi, Giancarlo; Michele Marchesi, 2001, 569 pages, webpage: Books-Google-VSCh, quote: "XP says 'do the simplest thing that could possibly work ' because 'you aren't gonna need it'."
  4. ↑ Lindstrom, Lowell; Carmen Zannier; Erdogmus, Hakan, eds (2004). Extreme Programming and Agile Methods – XP/Agile Universe 2004: 4th Conference on Extreme Programming and Agile Methods. Lecture Notes in Computer Science. Berlin: Springer. p. 121. ISBN 3-540-22839-X
  5. ↑ Fowler, Martin; Kent Beck (8 July 1999). Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, 431 pages, p. 68, webpage: BGoogle-1M. ISBN 978-0201485677. Quote: "you aren't going to need it".
  6. ↑ Poppendieck, Mary; Tom Poppendieck (2003). Lean Software Development: An Agile Toolkit, p.59, webpage: BGoogle-hQ. Quote: "Kent Beck, Extreme Programming Explained, Chapter 17, uses the acronym YAGNI (You Aren't Going to Need It) for this practice and explains its rationale."
  7. ↑ Olsen, Russ (2007). Design Patterns in Ruby, p.13, webpage: . ISBN 9780321490452. Quote: "This design principle comes out of the Extreme Programming world and is elegantly summed up by the phrase You Ain't Gonna Need It (YAGNI for short)."
  8. 1 2 3 4 Jeffries, Ron (1998年4月4日). “You're NOT gonna need it!”. 2007年11月7日閲覧。
  9. ↑ Carmack, John [@ID_AA_Carmack] (18 June 2021). “It is hard for less experienced developers to appreciate how rarely architecting for future requirements / applications turns out net-positive. https://t.co/lusGdzkfd3” (英語). 2022年8月16日時点のオリジナルよりアーカイブ. X(旧Twitter)より2022年12月2日閲覧.
  10. 1 2 3 extremeprogramming.com - You aren't going to need it. (YAGNI)>

関連項目