News for hackers. Stuff that matters.
Re:There’s No Such Thing as Clean Code by serial_dev on Friday January 28, 2022 @05:07AM (#30112747)
Yes, I agree with you. Another thing is how do you know which of the removed features will be asked to be put back? You can't really know.

You can guess, but that will leave you with many classes/functions commented out only in the hope that one day one of them will be requested to be put back. This leads to nobody daring to remove old code for months/years.

Then, one day, a new coder on the team just ask WTF is this here, realize it's outdated and not running anymore, and will remove the whole thing. Then, the "senior" guy on the team comes shouting at him/her: "We might need it one day, what do you know about our team, bla bla bla, we had a feature 4 years ago that was removed and we had to add back, so now we have the rule of commenting things out". Yuck, what a nightmare.

Just create good commit messages, don't group irrelevant changes together, and you'll be able to find the commit if you really have to. And even if you can't, you know you can still just develop that thing again, right?

Re:There’s No Such Thing as Clean Code by RMPR on Thursday February 03, 2022 @11:14AM (#30194272)
One solution might be to create a separate branch with the feature still available. With time, you kind of get the gut feeling of what could be useful later and what could not.
Re:There’s No Such Thing as Clean Code by zozbot234 on Friday January 28, 2022 @06:53AM (#30113517)
I thought the best practice for "keeping stuff around just in case" was an attic/ directory in the source repo. That way you're still benefiting from version control, but it's also clear that the code is totally untested and might bitrot at any time.
Re:There’s No Such Thing as Clean Code by dtech on Friday January 28, 2022 @08:19AM (#30114194)
There's little advantage over that vs looking up the old files in source control.