DEV Community

Discussion on: Is it worth reading source code?

Collapse
 
codemouse92 profile image
Jason C. McDonald

"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.

Collapse
 
joshcheek profile image
Josh Cheek • Edited

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

Thread Thread
 
codemouse92 profile image
Jason C. McDonald

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

Thread Thread
 
joshcheek profile image
Josh Cheek

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