Im agree with your post and the importance using YAGNI, but every new feature is different depending the project you are working on. Let's say that you have to code a new big feature, but you have to deliver it in steps, in order to let the client to see how is it working and put these functionality in the table letting the rest of the team to see how is this working for example. In that case, you can save a lot of time by doing every step in flexible way because you have the certainty that you are going to need it, which doesn't violate YAGNI principle.
Im agree with your post and the importance using YAGNI, but every new feature is different depending the project you are working on. Let's say that you have to code a new big feature, but you have to deliver it in steps, in order to let the client to see how is it working and put these functionality in the table letting the rest of the team to see how is this working for example. In that case, you can save a lot of time by doing every step in flexible way because you have the certainty that you are going to need it, which doesn't violate YAGNI principle.
If there is certainty, absolutely!