3 ms·
No. I write sufficient code for what is required of said function at that moment in time. It is only if and when required would I then add any additional parame
by userbinator 8y ago
No. I write sufficient code for what is required of said function at that moment in time. It is only if and when required would I then add any additional parameters and code to that function. Or write new functions.
I'll add that sometimes the more general solution also happens to be the simpler one, and in that case you should always take the simpler one even if it's more general, because then you have both the advantage of simpler code now and flexibility for future change.
To put it succinctly, "increase generality only when it decreases complexity."