YAGNIとは? わかりやすく解説

Weblio 辞書 > 辞書・百科事典 > 百科事典 > YAGNIの意味・解説 

YAGNI

(YAGNI原則 から転送)

出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2025/06/28 05:56 UTC 版)

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

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

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

理由

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

  • 後で使うだろうという予測の元に作ったものは、実際には10%程度しか使われない。したがって、それに費やした時間の90%は無駄になる[10]
  • 余計な機能があると、仕事が遅くなり、リソースを浪費する[10]
  • 予期しない変更に対しては、設計を単純にすることが備えとなる。そして、必要以上の機能を追加すると、設計が複雑になってしまう[10]
  • 人生の時間は、貴重である。したがって、人間の能力は、ただコードを書くためではなく、現実の問題に集中するために使うべきである[8]
  • 結局は、その機能は必要ないかもしれない。もしそうなったら、あなたがその機能を実装するのに費やした時間も、他のみんながそれを読むのに費やした時間も、その機能が占めていたスペースも、すべて無駄になってしまうだろう[8]
  • コードをすばやく実装するために最も良い方法は、あまりコードを書かないことである。そして、バグを減らすために最も良い方法も、あまりコードを書かないことである[8]

脚注

  1. ^ a b 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. ^ a b 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: [1]. 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. ^ a b c d 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. ^ a b c extremeprogramming.com - You aren't going to need it. (YAGNI)>

関連項目




英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「YAGNI」の関連用語

YAGNIのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



YAGNIのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
ウィキペディアウィキペディア
All text is available under the terms of the GNU Free Documentation License.
この記事は、ウィキペディアのYAGNI (改訂履歴)の記事を複製、再配布したものにあたり、GNU Free Documentation Licenseというライセンスの下で提供されています。 Weblio辞書に掲載されているウィキペディアの記事も、全てGNU Free Documentation Licenseの元に提供されております。

©2025 GRAS Group, Inc.RSS