Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In that case how to refactor a class that has 20 private methods? Moving them to another class and making them public would just shift the problem, not solve it


It's impossible to give a generic answer to this, it always depends on the specific domain. But I found that in these cases, there's always a design problem somewhere. Some responsibilities aren't clear, very often not much thought has been put into the design, and most of the time you can't give an immediate answer, which is why a bad design is chosen and causes a lot of damage down the line.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: