This is where coding becomes more art than science. There's an intuition that comes to knowing when it's time to abstract something and when the ad hoc implementation is better. And I do mean better, not faster, or lazier, but better. The sense among moderately experienced developers seems to be that the abstraction is always better, but it really comes down to good sense.