News for hackers. Stuff that matters.
Re:Refactoring vs. defactoring by Zababa on Wednesday October 27, 2021 @05:39PM (#29019461)
> Automated refactorings are fast and safe—even when you don’t have tests.

Depends on the refactor. At work some people tried to do some automated refactoring with Resharper, which changed names of fields of a class, which broke stuff that relied on them for reflection.

Re:Refactoring vs. defactoring by xg15 on Wednesday October 27, 2021 @05:59PM (#29019634)
I think that's more an argument against using reflection though. If you use reflection, you're effectively changing the rules of the language. No automated tool will be reliable after that.
Re:Refactoring vs. defactoring by Zababa on Wednesday October 27, 2021 @06:20PM (#29019797)
Fair point, but how does that help existing code?
Re:Refactoring vs. defactoring by splittingTimes on Wednesday October 27, 2021 @06:53PM (#29020039)
Great point. We use method/class names in config files that get parsed and dynamically evaluated. You could break the whole application by changing class names as an init config could fail.

Also persisting stuff in customer DBs that depends on class names (and reflection) is nice source of terror. Shipping a new version of your software with a refactored class names corrupts the whole DB of a customer.

Re:Refactoring vs. defactoring by Zababa on Wednesday October 27, 2021 @07:02PM (#29020102)
> Also persisting stuff in customer DBs that depends on class names (and reflection) is nice source of terror.

We do that but with XML files, most of our tables are dynamically generated. I'm a bit scared every time I touch this part.

Re:Refactoring vs. defactoring by splittingTimes on Wednesday October 27, 2021 @07:08PM (#29020170)
We have a whole framework that handles migrations of costumer DBs after updates. But when you don't even know that your changed class gets persistent (because of spaghetti inheritance/type hierarchy) and you do not enter it in the migration scripts, you duck up.
Re:Refactoring vs. defactoring by enb on Wednesday October 27, 2021 @06:16PM (#29019772)
Use nameof instead of a string literal to refer to names of types
Re:Refactoring vs. defactoring by Zababa on Wednesday October 27, 2021 @06:47PM (#29019986)
Thanks, I'll transmit the advice.