News for hackers. Stuff that matters.
Re:There’s No Such Thing as Clean Code by d0mine on Friday January 28, 2022 @03:04PM (#30119618)
I don't know about your experience but refactoring is just not on the menu in most commercial environments I'm familiar with, therefore if you always pick the first solution that cones to find, it is likely you have to leave with the consequences of the hack for a long time (until the system crumbles under its own complexity).
Re:There’s No Such Thing as Clean Code by skohan on Friday January 28, 2022 @03:52PM (#30120210)
I guess I have been lucky - I've always been able to negotiate for time to refactor if needed, or just find time for it in lulls between tasks. If you're in an environment where engineers don't have the freedom to improve their codebase I would not consider that to be a healthy practice, but that certainly would change the value proposition around upfront design.
Re:There’s No Such Thing as Clean Code by mbrodersen on Sunday January 30, 2022 @12:32AM (#30134362)
I refactor all the time and have done it for 25+ years. The result is solid code that is easy to maintain and close to bug free (no bugs in production the last 5+ years).
Re:There’s No Such Thing as Clean Code by d0mine on Sunday January 30, 2022 @03:28AM (#30135078)
Could you describe the process: did you need to justify the time spent on refactoring in any way? ("why known bugs, requested new features should wait until the refactoring is done"--I'm playing devils advocate here. I'm interested, how you justified it before the management if you had one)
Re:There’s No Such Thing as Clean Code by mbrodersen on Sunday January 30, 2022 @09:57PM (#30143971)
I never asked permission to do it. I consider refactoring to be part of my job. Small refactorings I do right away when implementing a new feature. Large ones I split into many small steps and work on for months in-between working on new features. Never underestimate the power of making a small improvement every day. I make sure that the long term refactorings never breaks the system or introduce new bugs. I have solid tests in place making sure changes doesn’t change behaviour.