Three Strikes

What is the difference between ThreeStrikesAndYouAutomate and ThreeStrikesAndYouRefactor?


PhlIp makes this interesting distinction between the two:

It's the difference between Space and Time.

If duplication occurs in Space (at whatever scale), you have a OnceAndOnlyOnce violation and you ambitiously fix it. (ThreeStrikesAndYouRefactor, or refactor before you get to ThreeStrikes.)

If duplication occurs in Time, then you the programmer have done the same thing twice. That's okay - that's what muscle memory is for. If, however, you do it three times, then you know enough to automate your activity. (ThreeStrikesAndYouAutomate)

For example, the third time you copy your source to a remote, backed-up location into a folder named after the current date & time, you should install CVS & automate this behavior.

Duplication in Time occurring only twice may not be enough to automate. You might not know yet if the odds you'll do it again are > 50% (with large margins of error), or maybe you haven't done it enough yet to know how to automate it right.


CategoryAutomation


EditText of this page (last edited November 22, 2014) or FindPage with title or text search