It's called "Therapeutic Refactoring" by Katrina Owen:
Ask HN: Codebase at my work is a complete mess, what should I do?
101–110 of 346 posts
Re: Ask HN: Codebase at my work is a complete mess, what should I do?
#102i have news for you, it’s like this at all companies.
you can’t fix it. it grew that way from the people there. you need to outnumber them 2:1 to make headway.
grin and bear it. fix what you can along the way. trust me, the next guy will consider your code garbage. no matter how good it is!
Re: Ask HN: Codebase at my work is a complete mess, what should I do?
#103Re: Ask HN: Codebase at my work is a complete mess, what should I do?
#104Start with high level integration tests of the most critical business processes. Then, work your way down to frequently used functions/classes/modules. After the whole thing is covered you can start cleaning/repairing, and I’d suggest doing so incrementally/as you’re adding new other features (make sure all new features come with tests).
Re: Ask HN: Codebase at my work is a complete mess, what should I do?
#105So you're the new guy that's been assigned to this project...possibly at the request of the current developer who desperately needs help...possibly because it's the project that existing staff don't want to work on...possibly to learn the project so the current developer can be moved to other projects. Every software company has these projects and many developers have been in your position. As long as the software is…
This should at least give you the opportunity to contain technical debt to the most complex requirements.
To say "everything is complex therefore we cannot rewrite anything" is pretty implausible and mediocre.
Re: Ask HN: Codebase at my work is a complete mess, what should I do?
#106Is it buggy? Is it insecure? Is it slow? If the answers to those questions are no. Then you the problem and you should look for employment elsewhere. You are unhappy in that job, and you rewriting the codebase would potentially make the above questions answer to a YES, inflicting damages in the company. Now, if the above questions have yes as an answer. Talk to your manager, explain how it won't scale, how it is hack…
A software project can be fast, reliable, and secure while also being extremely poorly engineered and extremely difficult to maintain and extend.
Re: Ask HN: Codebase at my work is a complete mess, what should I do?
#107Earlier quoted context omitted.
> The fact a new resource (you) has ... I am not familiar with this lingo. Why exactly is the OP a resource? Is this usage of "resource" common in business speak?
Unfortunately, yes. We are just replaceable cogs.
Its not art, it's a job. (to me)
Re: Ask HN: Codebase at my work is a complete mess, what should I do?
#108Then, isolate a section that is practically reeking. Maybe it's even so bad that it's leaked into the user experience. It has to be a super small part of the codebase though. Plan out the refactor, making sure to make it backwards compatible (that means no regressions, no changes to internal interfaces, etc.). Start the refactor, then when you reach about the 70% mark (which will be more like the 30% mark considering regressions and stuff), try to pitch the refactor. But don't pitch it as a refactor. Figure out any problem that the user or manager is having, whether it's slowness, crashing, etc. and then slide in your refactor as the solution. Like hiding spinach in brownies. If there aren't any problems, well, then maybe the codebase isn't that bad.
And remember, 50% good code and 100% done is better than 100% good code and 50% finished when it comes to refactors.