Skip Navigation
56 comments
  • This is actually not a good advice, from my experience. If we don't monitor, refactor, or improve the code, the software will rot, sooner or later. "Don't touch" doesn't mean we don't ever think about the code, but we make the conscious choice not to modify it.

  • Yeah, I've worked with the leave it alone types. What do you get in return? Components of your system which haven't been updated in the last 20 years and still run .NET 3.5. They obviously never stopped working, but you have security concerns, worse performance (didn't matter much in that case) and when you actually need to touch them you're fucked.

    Why? Because updating takes a lot of time (as things break with every major revision) and on top of that if you then decide not to update (yeah, same coworker..) then you have to code around age old standards and run into bugs that you can't even find on Stack Overflow, because people didn't have to solve those in the last 20 years.

  • Or you do the right thing re-write or refactor, apply the latest practice add some tests to it. This way you won't have a black box anymore. Who knows there might be a hidden bug there that might be a huge security issue and could bite you back in the future.

  • if it ain't broke, don't fix it.

    if it's still under-budget, break it carefully.

  • This week I am to propose two major redesigns to an external API and webpage on my rollercoaster of a project. Let's see this code monkey land a backflip :,)

  • ... said no programmer, ever. Especially not after hearing about a cool new feature in their favorite language or library that was just added in the newest unstable version!

  • Ice cold take: You don't have enough tests if you can't safely refactor on a whim.

    A well-tested project should allow you to refactor arbitrarily. As long as all existing tests pass, rewritten code is at least functionally equivalent to the previous code. This allows for fearless performance rewrites, refactoring, and even complete redesigns of components.

    In other words, the tests are more valuable than the code itself. The spec for the codebase proper should be defined by the tests. When the spec changes or grows, the tests should change or grow, and then the main codebase should be modified to pass all tests once again.

    TL;DR TDD evades this issue entirely and is fantastic for larger and/or longer-term projects

56 comments