loading...

Discussion on: Imperative vs Declarative programming. Your enemy is not object-oriented programming.

Collapse
thorocaine profile image
Jonathan Peel

On the discussion of not being imperative...

Do you not think one of the biggest strengths of OPP is that it should, on the surface, always be declarative.

Instead of have loops in your code you want to have a NemoFinder class (or a FishFinder depending on your needs) that will look for and give you Nemo back. You don't need to care about how it works until the point you need to implement it, with a loop or with a LINQ style library (which is still a loop written by someone).

If you practice OOP with a separation if concerns do you not find it ends up looking very declarative.

Collapse
vaibsgharge profile image
Vaibhav Gharge 👨🏻‍💻 Author

Yeah, I totally agree with that. There has to be separation of concerns along with the reusability and maintainability of the code.

That is why we have so many design patterns for OOP.