News for hackers. Stuff that matters.
Re:The faster you unlearn OOP, the better for you and your s... by undreren on Sunday November 25, 2018 @03:25PM (#18528812)
It isn't. Not in a significant way at least.

I think the main benefit of OOP isn't really abstraction, like modules, because even function signatures coupled to a struct definition can be a great abstraction. Abstraction is about generalizing something in order to hide its inner workings. Modules can do that just fine.

What OOP "got right" was to make it easy to use indirection to pass function pointers. That way, you can easily create pluggable systems at runtime, so that strategies can be dynamically chosen. Passing function pointers in c can be pretty tedious, if you need to send implicit state with it.

I've started to get really annoyed with indirection though. It's getting abused so thoroughly in order to make bad designs testable through dependency injection. I find that it is much easier to use dependency rejection instead.

Re:The faster you unlearn OOP, the better for you and your s... by scarface74 on Sunday November 25, 2018 @05:15PM (#18529416)
What OOP "got right" was to make it easy to use indirection to pass function pointers.

There was the part in my original post...

....and had structs with function pointers that did different things based on how the struct was initialized.