Is it gauche to repost my comment on my own blog?
I wrote this on this blog (which I enjoy), then decided it’s good enough to post here.
My favorite code advice is “if you need something >3 times, make it a function/object. Otherwise, re-code it inline.” Without this rule, I 1) underestimate the cost of developing reliable objects; 2) overestimate the effort required to code the same thing a second time; and 3) overestimate the likelihood that I’ll need to that function again (in that language/context) in the future.
What’s yours?