4 ms·
A huge problem with dirty code is that it is permanently owned by the author. In my experience, most dirty code isn't really owned by anyone. Person X wrote a
by samstokes 16y ago
A huge problem with dirty code is that it is permanently owned by the author.
In my experience, most dirty code isn't really owned by anyone. Person X wrote a widget, then something changed elsewhere to make it obsolete, but there wasn't time to rewrite it to properly reflect the new situation, so instead Person Y added some quick workarounds. Now neither X nor Y fully understands the widget any more. (Y might equal X - it's hard for a good programmer to feel ownership for a rush job they know to be suboptimal.)
Later, there's a codebase-wide optimisation drive, driven by person Z. Z asks who owns the widget, both X and Y shrug, so Z skims through the code, comes to his own incomplete understanding, and duct tapes over the patches from the previous rush job.
In this way the widget becomes a no-man's-land, where everyone goes to add a quick hack, but nobody wants to take enough responsibility for to nuke it from orbit.
- geophile 16y agoI've spent my career mostly at startups, and I see a pattern in which some critical piece of code is written by one person. Over time, or because the author doesn't value (or recognize) clean abstractions, the code becomes impenetrable, and only the author can maintain it. But I can see how a series of owners can produce the same situation.