5 ms·
> I'm essentially a believer in You Aren't Gonna Need It — the principle that you should add features to your software — including generality and abstraction Y
by satyanash 4y ago
> I'm essentially a believer in You Aren't Gonna Need It — the principle that you should add features to your software — including generality and abstraction
YAGNI is not a principle. It is a contextual thumb rule. A codification of expert intuition. Exceptions to thumb rules are quite the norm.
Conflating thumb rules with principles is a sign of sloppy thinking.
Often engineers will misuse terminology thinking that it "doesn't matter". But it does. Think twice before claiming that something is a principle.
The words you use highly influence your thought process[0].
[0]: https://en.wikipedia.org/wiki/Linguistic_relativity https://en.wikipedia.org/wiki/Linguistic_relativity
- FeepingCreature 4y agoIndeed. A rule of thumb is something you're supposed to use, at most, in the absence of any better information. I've written abstractions that didn't end up needed, sure. I've also written abstractions that I've been extremely glad for in hindsight.
- bazoom42 4y agoSo what would be an example of a software design principle?
- EdwardDiego 4y agoNever write a function called destroyBaghdad(). Instead name it destroyCity and pass the target as a parameter.
- dagw 4y agoIf Baghdad is city your users destroy most often, I would allow a destroyBaghdad() function that calls destroyCity() with all parameters set correctly.
- samatman 4y agoThis is why the US destroyed Baghdad. The contract is called CongressAuthorizesInvadingCountry(country :Country): Invasion Congress made a thunk with Iraq in it, so despite the lack of any real connection to Recent Events, the White House called it in 2003.
- gdy 4y agoUgh. Try writing destroyKiev instead and see what happens.
- EdwardDiego 4y agoLast time I tried, I got a 404 Competent Military Not Found error. :/
- gdy 4y agoMy point was that neither routune should ever be written and the Middle East would've been much better off if the world had started an all-out economic war against the US in 2003. In case you are wondering, I'm Russian, have friends in the Ukraine and destroyed Kiev is the last thing I want. Jokes about destroying Baghdad are just callous. Especially coming from Americans.
- EdwardDiego 4y agoGood thing I'm not American then. (And the joke I'm referencing is making fun of software ethics, so you're in violent agreement.)
- EdwardDiego 4y ago> Conflating thumb rules with principles is a sign of sloppy thinking Multiple dictionaries and thesauruses would disagree with you there. Rule of thumb is often defined in terms of "rules, procedures, principles, or... ...derived from..." Some sources say that "rule of thumb is a principle or procedure..."" So, you know, going straight to "sloppy thinking" reminds me of OldManYellsAtCloud.jpg. Anyway, I'm really not sure what difference you perceive - principles are often derived from experience, as well as theory, and they often have exceptions too. Many people have a principle of not committing violence, for example. _Except_ when (multiple clauses follow).
- gpderetta 4y agoPragmatism vs Dogmatism. For example DRY vs YAGNI. The first is more dogmatic: refactor everything that can be refactored, while the second is more pragmatic. The refactor is probably not necessary and might turn out not to be necessary. An even more pragmatic rule is the You Aint Gonna Need It Yet.
- EdwardDiego 4y ago> Pragmatism vs Dogmatism. For example DRY vs YAGNI. DRY often has exceptions to the "rule"/"principle" too though. And people often blog on these exceptions. And pragmatism and dogmatism aren't a xor, they're just convenient labels for the -X and the +X ends of the axis. (Admittedly, the fact that I've seen more "It's okay to have exceptions to DRY" blog posts than "It's okay to have exceptions to YAGNI" indicates you're right about their relative weighting on that axis.)
- galangalalgol 4y agoThat is because DRY sets a puzzle for us, how to cleanly reuse some code. YAGNI on the other hand, denies us a puzzle. We like puzzles.
- EdwardDiego 4y agoI like your thinking on this
- Vinnl 4y ago> The words you use highly influence your thought process Given that the article is literally about exceptions to YAGNI, and explicitly calls out that there are probably more, their use of the term "principle" doesn't appear to have caused them any harm.
- samhuk 4y agoYour semantical argument of "principle" vs "contextual rule of thumb" is incorrect. They mean the same thing in almost every context, according to any dictionary/thesaurus you find out there. In fact, the ultimate defining characteristic of a "principle" is that it has exceptions and should not be used as the "ultimate word of God". Even in Physics, where most would think a "principle" means something "without exception", they are only ever currently without exception according to current evidence. There has been countless times where there has been a scientific principle only to be disproven later on. Lastly, you link Sapir–Whorf, which, quite ironically, is considered a "principle" yet has had much criticism over time, which contradicts your own argument. However, I will agree with you that one should always be careful of the language they use since it can affect how others view your thoughts, feelings, and intentions.
- Supermancho 4y ago> This can apply to protocols, APIs, file formats etc. It is good to think about how, for example, a client/server system will detect and respond to different versions ahead of time (i.e. even when there is only one version), A blogpost/article about YAGNI manages to suggest a rather nuanced feature should always be included, that isn't needed, right up front.
- westernpopular 4y agoYou say > The words you use highly influence your thought process[0]. Yet in the very article you link it says (emphasis mine) > The strong version, or linguistic determinism, says that language determines thought and that linguistic categories limit and determine cognitive categories. This version is generally agreed to be false by modern linguists.[3] > The weak version says that linguistic categories and usage only influence thought and decisions.[4] Research on weaker forms has produced positive empirical evidence for a relationship.[3] Your use of 'highly' would suggest a strong relativity, but that's discredited. Signed, a disgruntled linguist who's tired of people banging on about Sapir-Whorf.