Closed sewelseb closed 2 years ago
I don't think that we should merge this. The current code is perfectly readable and I find splitting it into tiny methods not really helpful.
ok, no issue. As I have said, feel free to reject it.
Just to explain why I like small functions: I like to have functions that are shorter than 5 lines of code. The reason is that most of the time if it is longer, it breaks the single responsability principle. When I (a new developper) entered the code, it was difficult for me to understand it.
Anyway, it was a pleasure to read your comments and feedbacks.
The reason is that most of the time if it is longer, it breaks the single responsability principle.
This package and especially the class you're fixing here is pure integration code. It's glue between a framework and a library. By design, such a class violates the SRP: You will need to change it whenever the integrated library adds, removes or changes functionality that this package is supposed to integrate. And splitting this class into microscopic methods does not change that: it's still a class with multiple resposibilities. And that's fine.
The reason is that most of the time if it is longer, it breaks the single responsability principle.
This package and especially the class you're fixing here is pure integration code. It's glue between a framework and a library. By design, such a class violates the SRP: You will need to change it whenever the integrated library adds, removes or changes functionality that this package is supposed to integrate. And splitting this class into microscopic methods does not change that: it's still a class with multiple resposibilities. And that's fine.
ok, thanks :)
Technically, this class has a single responsible: configure the container services based on the user-provided configuration. The difference is the size of the code needed to implement that responsibility. For such responsibility, 5 LoC is not enough.
Anyway, I'm closing this for reasons already given in comments.
I tried it as a training for myself in refactoring. don't hesitate to reject, but please provide me feedbacks (if you have time)