Has someone ever told you "Don't re-invent the wheel"?
But here, I advocate my pro's (the cons can be found elsewhere) for re-inventing the wheel, or at least not being frightened of it. You can also read the follow-up: 8 reader reasons for re-inventing the wheel as a programmer.
1. I don't like the default wheel color: Sometimes you need a specific type of algorithm, one that the 'library standard' just does, without the bells and whistles you need. Writing your own version allows you to tweak it to suit your problem domain. Do it!
2. I want a bigger wheel: What happens when the usual algorithm doesn't fit at all? When you need to write really context-specific code, working with generalistic libraries is impossible. Even worse, what happens when you are writing the specific library? Go ahead!
3. I am a wheel engineer: if you are deep in the know-hows of the subject, re-inventing the wheel is a way to be sure of your complete knowledge of your domain of expertise. A kind of self-knowledge test. Test it!
4. I want to know how does the wheel work: related to the previous item, but focused to amateurs on the subject. I feel this way quite often, and sometimes this has paid off in the long run. This can lead to spicing up a boring afternoon. Discover it!
5. My wheel is better than your wheel: Pride. You can write it better, can't you? Closely related to the programmer virtues: laziness, impatience and hubris.(check this page for them). Be proud of it!
6. Proprietary vs free: maybe the wheel you want to use is a proprietary wheel, thus you can't add it to your open-source project, or have to pay some fee to use it. Free it!
7. Create a new wheel: you need to know how the old stuff works to be able to create the new big thing (usually, in most areas). We are standing on the shoulders of giants, but if we don't know how tall they are, we can step over midgets. Learn it!
8. Boredom: maybe you have a free Sunday afternoon and don't want to code something over-the-top, and you decide to write your own algorithm for X. Closely related to reasons 4 and 5. Enjoy!
Do you have your reasons and they are not in this list? Post a comment and I'll write a new (collaborative) version! (Written! 8 reader reasons for re-inventing the wheel as a programmer).