This article was not really that informative and was a bit clickbaity.
Just use it. It will detect all the hidden complexity and will not allow your code to rot.Basically each function should only do one thing.
Congratulations, we now have a well-known anti-pattern in our code. Do not use boolean flags. They are bad.What is an anti-pattern? What is a boolean flag. I'm excited to learn about these things.
Before we start discussing callable objects, we need to discuss objects and OOP in general keeping SRP in mind. I see a major problem in OOP just inside its main idea: “Let’s combine data and behavior together”. For me, it is a clear violation of SRP, because objects by design do two things at once: they contain their state and have perform some attached behavior. Of course, we will eliminate this flaw with callable objects.Yeah the premise has some faults, but every premise does.
No comments:
Post a Comment