3 ms·
It's kind of a strange response when the author already explicitly said "people think they always need to formally encode parent-child relationships but sometim
by civilized 3y ago
It's kind of a strange response when the author already explicitly said "people think they always need to formally encode parent-child relationships but sometimes they don't, sometimes nested display is all that's needed".
What's the response here? "No, that can't possibly be true"?
You Aren't Gonna Need It is a celebrated building heuristic for a reason. You Should Always Assume You Need It simply isn't true.
- tadfisher 3y agoYou're Gonna Write A Migration For This When the PM Asks For Batch Operations On Subtrees isn't as catchy, I suppose.
- deleted 3y ago[deleted]
- nerdponx 3y agoI worked with some YAGNI zealots and this was a routine experience. I adopted the philosophy of IYHTAYPGNI, "If You Have To Ask, You're Probably Gonna Need It".
- NAR8789 3y agoWill you really need a migration for that? OP's storage is already in depth-first order, so subtrees are easy to fetch.
- ramijames 3y agoExactly this. You plan around what might be needed in the future. I've found some extra work now is usually a lot less work in the future.
- moron4hire 3y agoThere's YAGNI and then there's Suitable for Purpose. If you display a thing like a tree, then people are going to expect to do tree-like things to it, like collapse views and reorder items. You might as well just git gud at tree operations and save yourself the hassle once and for all of chasing down edge cases every time a new feature request comes in for things that should have been natural extensions but you omitted "cuz YAGNI".
- civilized 3y agoJust because something has a tree structure, it needs to be able to support all tree operations? Why is that such a compelling argument to you? What if it just doesn't?
- setr 3y agoIt’s more like: if something has a tree structure, and the project scope is not 100% finalized, then more likely then not tree operations are going to eventually be requested. The cost savings from the hack is so low versus a standard tree representation that it’s unlikely to be worth the risk this occurs
- civilized 3y agoThe cost savings is low but the risk is high? How do you figure? It sounds like both options are easy (one is just even easier) so there's not much risk if we have to switch.
- moron4hire 3y agoThe thing is, once you learn how to do tree operations, they aren't that hard to do. I'm not talking about learning how to balance a binary tree in the most efficient way possible. I'm talking about the basic ops of breadth- and depth-first traversals of arbitrary trees. I feel like we live in an era of software development that took a stupid meme about "inverting a binary tree" as a job interview question and--not knowing anything about trees--turned it into received wisdom that "trees are hard". But they just aren't. And yet so many people live in fear of them and go to great lengths to avoid having to learn how to use them.