News for hackers. Stuff that matters.
Re:On over-engineering; finding the right balance by tommiegannert on Wednesday September 11, 2024 @04:03AM (#41509144)
> public void RemoveItems(Func<Item, bool> condition)

Tangential, but remember that you can't generally push this condition over a database connection. You've just forced your code to be best-case O(n).

Using structured queries as far as possible is useful for performance. But consider what happens if you create a Predicate structure, and someone adds a field without updating the Remove function to match... Perhaps a recursive discriminated union is the way to go, for languages that fail compilation when not all branches are covered? Positional arguments in other languages?

There are no comments on this comment yet.