Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is it so hard to enforce YAGNI? [closed]

I find myself breaking this pattern all the time.

YAGNI - You Ain't Gonna Need It

I am only a Junior Developer, but I find even Senior level developers doing the same thing.

"Well, this system might use it, and this one, so let's design for it."

Sometimes, I catch myself, but most times I run wild. Does anyone have any tips for sticking to YAGNI, or anything I can do to better enforce this design pattern while I am designing and coding?

like image 476
Martin Avatar asked Sep 16 '09 14:09

Martin


1 Answers

Designing FOR something

...is completely different than

Designing something.

Designing for something means you're architecting your application for future expansion in case the need arises to write the code (which is good...it means you're making your software extendable and easy to maintain).

Designing something means you're writing the whole piece now...whether you think anybody is actually going to use it or not. That isn't necessarily a bad thing, but it can be a huge waste of time.

Be careful about which one you're doing.

like image 56
Justin Niessner Avatar answered Oct 07 '22 00:10

Justin Niessner