Well it’s in the name, they are code smells, not hard rules.
Regarding the specific example you cited, I think that with practice it becomes gradually more natural to write reusable functions and methods on the first iteration, removing the need for later DRY-related refactorings.
PS : I love how your quote for the Rule of Three is getting syntax highlighted xD (You can use markdown quotes by starting quoted lines with >
)
Reminds me of the time when I bind mounted my home dir in a chroot, then
rm -rf
ed the chroot when I no longer needed it…