4 ms·
To use a math analogy, I think of idioms as solutions to generalized coding problems. If you recognize your situation as a special case of the general form you
by extr 9y ago
To use a math analogy, I think of idioms as solutions to generalized coding problems. If you recognize your situation as a special case of the general form you can save yourself some time thinking through the implementation and make it easier to understand. Great. But also like math, you can get yourself into trouble trying to frame something in terms of a general case that doesn't actually fit, suddenly the plumbing is more complex than the original problem. The same thing plays itself out at a higher level with design patterns. The (obvious) point is not to force a solution into an abstract pattern at the expense of clarity, because that's the reason we like abstract patterns in the first place.