is it worth (or are you) refactoring methods with 10 or so arguments to make them more readable?
Yes, it's worth it. As a rule, it is more important to use refactoring methods that are not "reasonable" than those that are already good, short and have a small list of arguments.
As a rule, if you have many arguments, this is because the method is too much - most likely, it should be a class, not a method.
Moreover, in cases where many parameters are required, it is best to encapsulate the parameters in one class (i.e., SpecificAlgorithmOptions) and pass one instance of this class. This way you can provide clean defaults, and it is very obvious which methods are necessary and optional (depending on what is required to create the parameter class).
Are there any better methods regarding how long the methods should be? How long do you usually keep them?
The method should be as short as possible. It should have one goal and be used for one task when possible. If you can break it into separate methods, where each, as a real, high-quality "task", then do it with refactoring.
are monolithic classes bad?
Yes.
Reed copsey
source share