Hacker News new | ask | show | jobs
by wanderr 1618 days ago
I agree that it’s a business problem. Cost, prioritization, rapid hiring, promotion incentives all play a part. Nobody usually funds a project to go through and clean up code. My last two jobs before I went fully down the management track, I deleted 100k-200k lines of code by applying static analysis, deleting obviously dead code, finding obviously broken code and figuring out whether it was being used (thankfully it mostly wasn’t, in the few cases where it was I could replace it with calls to properly working methods that already existed). I consistently deleted more code than I ever wrote, but every time I deleted code it was on a personal whim, not because it was a funded activity, even though it also improved productivity (engineers wasting time maintaining dead code). Once a codebase reaches a certain size, it’s not realistic for someone to get comfortable enough with the entire codebase and how everything interacts to be confident that major changes won’t have unintended consequences, so even if someone wants to go rogue and do a major cleanup effort, they will only get so far.

Now I try to make sure my team has time allocated to paying down technical debt, but most of the time that is enough to keep the situation from getting worse, more than really improving the situation.

1 comments

Yeah so Don Knuth says if you want a measure of productivity add the amount of code that's written to the amount of code that's deleted. In the same vein, make one to throw away. Final concept from Knuth: 1 in 50 people have the "computer scientist's mindset".
This is probably not what he had in mind, but I love make one to throw away, for experiments. Product and VPs often have a damn hard time wrapping their minds around it though. I saw it working with my own eyes! What do you mean we can’t ship it?! My latest product partners have no trouble understanding the value when they see that their experiments get shipped in half the time, it’s well worth it to get twice as many experiments out even if GA takes twice as long, because 2/3rds of experiments should fail anyway.