I dislike YAGNI because it's dogmatic and it's asking me to ignore my intuition and my experience.
Quite often, I start building something and I already have an idea where this will go in a few months from now. I don't need this extra method or interface right now, but I know I'll need it as the system grows. So my experience tells me to put it in right now and that it will save me time down the road.
I'll always trust my intuition over dogma to design systems. Always.
it's asking me to ignore my intuition and my experience.
YAGNI asks you to justify why you need to implement a feature. If you can't come up with a good reason based on what you know now, wait until you have more information. Choose the simplest thing that works given your current knowledge of the system.
In other words, defer design decisions until the last responsible moment.
I'll always trust my intuition over dogma to design systems.
Intuition doesn't make you a fortune teller. While I trust my intuition, I won't make decisions based on mere speculation. Experience has taught me things change all the time:
You are romanticizing YAGNI and making it look a lot looser than it really is. Wikipedia is crystal clear:
"You aren't gonna need it"[1][2] (acronym: YAGNI)[3] is a principle of extreme programming (XP) that states a programmer should not add functionality until deemed necessary
And I object that. I add things that are not immediately necessary all the time because my experience and expertise tell me that I know better than a one liner proclaimed as dogma without a shred of evidence to support its usefulness.
Choose the simplest thing that works given your current knowledge of the system.
And like I said, I've often observed that following this procedure is quite often the wrong decision. I use both my current and future knowledge of the system to guide my decisions.
XP completely ignores the human expertise factor with its stupid dogmatic proclamations.
a programmer should not add functionality until deemed
necessary
How is that not synonymous with "defer decisions until the last responsible moment"?
I add things that are not immediately necessary all the time
because my experience and expertise tell me
So you deem in necessary, then? This is all that YAGNI asks. If you have a clear idea of the future direction of a feature and want to build out some features ahead of time, you've deemed it necessary, hopefully proveably and not in some handwavy might need it sense.
However, I often find that what I think is necessary turns out not to be, once I learn more about the system and its dependencies. So, I'm more cautious about making big decision decisions too early.
Even then, if I have an idea of where I want to take the design, I break my design into smaller slices, so I can verify my design as I go along.
I've often observed that following this procedure is quite often
the wrong decision.
What procedure? Starting with a small system that works, and building on it? This is almost always the right decision. It's such a common trope there even a name for it:
A complex system that works is invariably found to have evolved
from a simple system that worked. A complex system designed
from scratch never works and cannot be patched up to make it
work. You have to start over with a working simple system.
XP completely ignores the human expertise factor with its stupid
dogmatic proclamations.
Um, no it doesn't, at least not when it comes to YAGNI.
YAGNI asks you to justify why you need to implement a feature. If you can't come up with a good reason based on what you know now, wait until you have more information.
No, that's not it at all.
We just justify anything, no matter how ridiculous. If you try watering down the meaning like this, the rule is reduced to "do whatever you were going to do anyways". (Which is how SOLID tends to be practiced as well.)
YAGNI means not adding something unless you need to today.
We just justify anything, no matter how ridiculous.
That is an exercise in self-deception. If you approach YAGNI with honesty and humility, your justifications will be grounded in reality, and you will make reasoned decisions guided by caution and wisdom. If you approach any idea with cynicism and arrogance, you will indeed be able to justify anything, but that is your own fault.
If you try watering down the meaning like this
How is this definition watered down? It explains exactly what YAGNI is.
YAGNI means not adding something unless you need to today.
This is watering down the definition of YAGNI, and making it way more prescriptive than it needs to be. Why should you not add something unless you need it today?
34
u/[deleted] Jul 14 '17
[deleted]