I agree with this to some extent. but there’s a flip side too. This mentality is often taken way too far. I had an old boss who wouldn’t allow me to write unit tests citing this thought process. Even at places with decent engineering practices, I’ve seen so many examples of software where you’re limited to a one to many relationship for something that could and easily should have been implemented as many to many, ren…
Ive seen a lot of engineers complain about YAGNI being taken too far but none who have seen their concerns validated by reality.
But tautologically you can't take YAGNI too far, if the "YAGN" part is actually true :-). But that is always under debate.