特定のパターン以外にも、設計原則であるDRY、KISS、YAGNI、およびその他の原則は、良いコードを書くためのガイダンスとなります。これらの覚えやすい原則は、シンプルさ、重複の排除、および過度な構築をしないことについての根本的な知恵を捉えています。
コア原則
DRY (Don't Repeat Yourself) → avoid DUPLICATION → each piece of knowledge has ONE
authoritative representation (duplication → bugs/changes in many places)
KISS (Keep It Simple, Stupid) → favor SIMPLICITY → simple solutions are easier to
understand, maintain, and debug (avoid unnecessary complexity)
YAGNI (You Aren't Gonna Need It) → don't build features/flexibility you don't NEED yet →
avoid speculative generality (build what's needed, not what might be needed)
