Never love your code
We often find programmers to be too stubborn to change their already written code. The main problem which they face is that even in a discussion with others, their opinion remains biased as they only think from the approach that they have already taken.
This biased thought process never let them think from other’s perspective because of which they miss many insights of different approaches to solve a particular problem.
While debating with someone over two different approaches for a problem we often find ourselves defending the approach we have already adopted. One solution for this problem can be to just put yourself on the other side and start giving arguments in favour of the second approach to convince someone else. This way even you will think about the pros and cons without being biased.
We should always keep this in mind that our ultimate goal is to write best possible solution, or while working in an organisation, our goal should be the best overall outcome of the team. So, even if you remain stubborn and do not change your code, in future there could be a possibility that some other person will delete your code and write it from the beginning. Thus, we should be responsible enough to remove our code ourselves and then rewrite the code after taking inputs from everyone.
“Progress is impossible without change, and those who cannot change their minds cannot change anything”