Skip to main content
11 events
when toggle format what by license comment
19 hours ago comment added benxyzzy "the time it takes will be more unpredictable: A small change might take 5 minutes or 5 days, and you won't be able to tell in advance which one it will be. Make sure the higher-ups understand that" -> they'll want to remove and replace the source of estimate uncertainty, i.e. rewrite the codebase. Literally saw this play out at my previous place. Left 18 months ago but FWICT the rewrite continues...
yesterday comment added Lundin @Yakk Oh I have done that too, after struggling with fixing the mentioned trainwreck project, I took up another project by the same guy and refused to maintain it given the previous experience. It worked great after I had rewritten it from scratch. The core problem here was that the person who wrote the original code had no idea what the original code did... :) I knew what it was supposed to do though, so I had greater success than them in creating an actual working product.
yesterday comment added Yakk @Lundin "I think I would have been better off if I had rewritten it" is NOT THE SAME AS "I rewrote it and it worked great". There are hundreds of situations where "I think rewriting it would be less painful" to the one case of "rewriting it was less painful". The fundamental problem is both fixing and rewriting require fully understanding what the original code does. If you don't fully understand what the original code does, rewriting is a huge gamble. And working out how it works exactly is the hard part of fixing it. Rewriting pretends you can skip over that part.
2 days ago comment added J. Mini Note that "Things You Should Never Do, Part I" has never had a Part II.
2 days ago comment added AnoE On that link Things You Should Never Do, Part I: Never listen to advice that begins with "Never ...". ...
2 days ago comment added keshlam Upvoted the moment I saw "do not make the mistake of trying to rewrite it all immediately." If you do want to clean up code, the best solution is to do so piece by piece when you are already working on that code, and the pieces may be smaller than individual files. If doing more than that is really needed, it is usually better to get the specifications and start from scratch, reusing existing code when appropriate, rather than trying to keep all of the existing code structure and "just modernize it."
2 days ago comment added David R And remember that there are at least two levels to any piece of bad software, the module level and the overall function level. Rewriting from scratch requires understanding both levels. Rewriting just a module to make it easier to understand and maintain can be done in the context of "fixing a bug" while rewriting the function level requires far more time and effort.
2 days ago comment added Heinzi @Lundin: I agree that there are exceptions to that rule, and, yes, I have also done my share of from-the-scratch-rewriting. As you say, it depends on the situation. In my experience, "technical infrastructure" code is much easier to rewrite than "business logic" code where you can't say for sure whether that strange if condition is a bug or a deliberate change based on a long-forgotten, undocumented user requirement, which might or might not still be required.
2 days ago comment added Lundin One particular project I spent nearly 3 years at salvaging a trainwreck of a code base and the product is still glitchy and unsatisfactory. If I had rewritten it from scratch that would have taken at most a year and likely resulted in a much better product. It depends on your skill and experience of course - rookies are usually very bad at program design so writing something from scratch for a rookie will not necessarily mean that the new code is any better, just a different kind of mess. But at least maintaining your own mess is far easier than someone else's mess :)
2 days ago comment added Lundin "Do not---I repeat: DO NOT---make the mistake of trying to rewrite everything from scratch" It kind of depends on the situation and the size of the project. You cannot say for sure that rewriting everything from scratch is always bad. I've been in plenty of projects where I decided to maintain the badly written mess as it is, then later realized that it would have been much better, faster & cheaper just to rewrite the damn thing from scratch, as that was what I had essentially been doing anyway, file after file, while hunting down bugs.
2 days ago history answered Heinzi CC BY-SA 4.0