This is far from a universal best practice and heavily depends on what code it is and for what reason you are duplicating it potentially.