| Essay 5 | Throw Away Your Old Code |
Recently, one of my colleagues, Mustafa, mentioned that I was “doing it again.” I was code hoarding: commenting out code that I wasn’t really planning on ever using again. I just didn’t have the heart to delete it right then, even though we version control all of our source code (and you absolutely should be doing the same). Since I could always get that old code back anyway, there was no reason to be commenting out code when I could just delete it.
Code hoarding is one of many habits that seems right on the surface. It’s a carryover from other staple engineering principles that aren’t really relevant to programming. If we were building a car, we would probably save all our scrap metal because we could reuse ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access