DEV Community

Discussion on: Practicing YAGNI

Collapse
 
gonedark profile image
Jason McCreary • Edited

Ideally, you wouldn't have decided on a design pattern upfront. Instead, you would have deferred the decision until you felt the pain and at that point realized the appropriate design pattern.

In the real-world, I understand this isn't always possible. So, given you have chosen a design pattern and have now found it's not the right one, I would swap it out. Nothing is sacred.

If code you have written no longer fits, don't be afraid to replace it throughout the code. If it works mostly and needs adjustments, practice YAGNI and do the simplest thing that could possibly work (you mentioned adding a constraint).

YAGNI is just one principle of extreme programming. Unless accompanied by lean process it can be jarring. So definitely be sure there is a way to share these sweeping design decisions. So long as there is, they shouldn't be feared.

Feel free to get more specific. I love this stuff…