Although commercial codes facilitate carrying simulation and postprocessing the results, still writing your own codes with its tedious efforts seems attractive. If you have the option, what do you prefer to do?
I agree with you Dear Andrew. Moreover, you feel proud when you have your own code comes to be a tool for you and others with you in solving practical problems. Programming is a tough task, but worthy to go through.
Of course it's best to write your own code; nothing clears the understanding of a topic/ algorithm better than implementing it. However, more often than not a study requires multiple techniques and their corresponding algorithms that are already available and well-tested in different languages. Writing those codes again will cost a significant amount of time, and they can't be patented/ copyrighted. I think a selective approach is best here; if I understand the mathematics/algorithm behind it, I will use use the available code and change it where necessary to meet my needs.