I always try to make my code simple. The first attempt helps understand the problem. More refinements explore alternate ways.<p>Once I have written a 'good' version (good technique, clean code and factorized) I often find it does what I need, but too generically. Later revisions to add features often also rewrite, specialize and simplify.