http://qs321.pair.com?node_id=162660

It's almost an automatic given that whenever you post a question about some code you've puzzled over for days, someone will point out that module X or project Y already does that, and say "Don't re-invent the wheel!". That's fine. You should know that there exists code out there that has already solved the problems you're facing. And you should normally use that code if time or reliability is critical.
However, if you've got the time, "re-inventing the wheel" can be a very strong teaching tool. What better way to learn real programming than to actually do real programming, knowing you have a working example to refer to if you are stalemated by a problem? And when it's done, you can compare your works to see where you could have done it better. This often sheds light on things beyond simply "getting it to work", like writing more maintainable, re-usable, secure and efficient code, in a concrete way that books often have a hard time conveying. You begin to really understand things like, "why I need to implement file-locking 'this way' to prevent race-conditions" or "why I should not shell out to do this with backticks".
And once you've become enlightened, you won't be so quick to tell the next guy, "Don't re-invent the wheel!".

-- O thievish Night, Why should'st thou, but for some felonious end, In thy dark lantern thus close up the stars? --Milton