News for hackers. Stuff that matters.
Re:Ask HN: Where do I find good code to read? by Zetice on Thursday August 24, 2023 @09:26AM (#37248483)
The problem with this “maintainability” argument is the presumption a) that it will be maintained (note I recommended rewriting frequently) or that b) it’s in conflict with meeting business objectives.
Re:Ask HN: Where do I find good code to read? by alpha_squared on Thursday August 24, 2023 @01:18PM (#37251729)
Rewriting frequently (reference a) is often out of the hands of the developer because of (reference b) business objectives. Writing code is entirely in the hands of the developer only at the time of writing, not a "henceforth and forever" sort of situation.
Re:Ask HN: Where do I find good code to read? by johnnyanmac on Friday August 25, 2023 @12:52AM (#37258221)
And I suppose a dev who only cares about paying the bills would still resonate with this advice. It's not their problem once the suits take charge of the product and give a thumbs up. Why bother with future dev maintenance? the suits will pay for that bride when it burns down, and having that happen is 100x more easy than trying to explain good code upkeep that delays business for a few weeks.
Re:Ask HN: Where do I find good code to read? by eternityforest on Thursday August 24, 2023 @02:10PM (#37252514)
Rewriting throws away years of accumulated edge cases handling. Suddenly the thing doesn't work because one particular model of printer needs an undocumented command to enable some feature, or users are inputting bad data because you forgot the checks you accumulated...

Seems not ideal for end users, unless you're working with microservices or something with well defined specifications that people are actually paying attention to.

Re:Ask HN: Where do I find good code to read? by Zetice on Thursday August 24, 2023 @05:30PM (#37254792)
Depends on the field, but what I work on generally evolves so much over time that by the time I'm ready for a rewrite, the "edge cases" I had to account for when I started are either solved, partially solved, or can be isolated into some tiny part of the codebase that could be ported over from the previous code.

Beside, "rewrite" here doesn't mean "new repo, new project, new everything" it means reimplementation, usually based on the lessons learned from the previous implementation, and that does include edge case handling, as well as expanded functionality to "underwrite" or justify the effort spent on the rewrite.

Re:Ask HN: Where do I find good code to read? by vendiddy on Friday August 25, 2023 @08:33AM (#37260977)
Rewriting does not need to be an all-or-nothing endeavor.

If you design your app as a collection of subsystems, it's sometimes faster to destroy and rebuild one of them than it is to refactor.