Skip to content

re: Is it worth reading source code? VIEW POST

re: When I work on any project, I have a phrase in my mind that I confirmed in time "Learn to reinvent the wheel, but don't reinvent it". If I know how...

"Reinvent the wheel" is a funny phrase when you consider just how many times we literally have had to reinvent the wheel (compare and contrast: stone wheel, bike wheel, car wheel, ATV wheel, airplane landing gear wheel....). We absolutely need to know how to reinvent the wheel, otherwise we'd all be rolling around Flintstones style still.

That said, we should only be reinventing the wheel if (a) existing wheels don't meet our current needs, and/or (b) we have a specific original improvement in mind that will make the wheel better in a given use case. That, of course, means we have to know a lot about the wheels that exist. Ergo, your reason for reading source.


Best to consider refactoring before considering rewriting/reinventing, IME.

Depends entirely on the code base. Rewriting is usually much quicker than refactoring someone else's spaghetti.

I'm advocating considering refactoring first, not saying it is always the answer.

code of conduct - report abuse