[Science,Technology, Engineering, Arts and Maths]

rule 3

Rule #3:

Once the same code is replicated three times, it should be extracted into a new procedure.

– by Martin Fowler in his text “Refactoring” and attributed to Don Roberts