Hacker News new | ask | show | jobs
by syllogism 3098 days ago
Yagni is a duality though (like a trinity, but two). You've just met Yagni's other face, You Are Going To Need It.
1 comments

An important corollary to this is "0, 1, many".

Any time you are storing data, the acceptable number of items to handle are none, exactly one, or a number limited only by machine resources. Don't design a container to hold, say, up to 5 items.

On the other hand, instantiating/specializing a container to hold up to 5 items can be a perfectly reasonable thing to do, depending on the application. It might be a design requirement that a safety-critical program never has to restart due to heap fragmentation, for instance.
I don't understand. I would just about never want to use an unbounded buffer, for example, for a channel.
Yes but that is an artificial limit and not an architectural limitation. i.e. a feature added to code that was once / would have been infinite otherwise.