นอกเหนือจาก patterns ที่เฉพาะเจาะจงแล้ว หลักการออกแบบ อย่าง 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)
