Re:The controller pattern is awful (and other OO heresy)
by MetaWhirledPeas on Monday July 10, 2023 @01:16PM
(#36669467)
I do some programming, but not OOP. Over the years I've read about it and asked colleagues about it, and the why question finally settled on it helps you organize your code. I can get behind that. But I also want to understand why OOP instead of conventional programming; I'm still waiting for that part to click. Until that question is answered it won't be capturing my full attention.
[ Parent
| on HN ]
Re:The controller pattern is awful (and other OO heresy)
by tesseract on Monday July 10, 2023 @01:26PM
(#36669662)
I've never really seen this explicitly stated anywhere, so maybe this is some super idiosyncratic idea on my part, but it's always seemed to me that one of the key pieces of OO is the use of polymorphism as a sort of syntactic/conceptual sugar around function indirection, that many people seem to have an easier time understanding and reasoning about.
Re:The controller pattern is awful (and other OO heresy)
by hfkwer on Monday July 10, 2023 @01:20PM
(#36669551)
What is "conventional programming", pray tell?
Re:The controller pattern is awful (and other OO heresy)
by dsego on Monday July 10, 2023 @01:56PM
(#36670287)
Maybe procedural?
Re:The controller pattern is awful (and other OO heresy)
by KerrAvon on Monday July 10, 2023 @02:53PM
(#36671221)
I think the root rant here, which I personally find unconvincing, is thinking in terms of OOP vs functional programming. Procedural isn't the opposite of OO; objects are composed of many procedures.
Re:The controller pattern is awful (and other OO heresy)
by MetaWhirledPeas on Monday July 10, 2023 @04:47PM
(#36672738)
I wasn't intending to trigger anyone but it seems I have. Perhaps I should have stated it as, "why OOP instead of organizing the code through other means?" It's a genuine question I have, and it just hasn't clicked for me yet, personally. So it's not really trying to be convincing at all; I'm just sharing my experience.
Re:The controller pattern is awful (and other OO heresy)
by c_crank on Monday July 10, 2023 @04:55PM
(#36672837)
The most compelling scenario for OOP is situations where, in its absence, a developer would tend towards reimplementing some OOP concepts over time. I think it is a natural fit for game development and some other things, but I don't think it melds so well with that thing we call 'business logic'.
Re:The controller pattern is awful (and other OO heresy)
by dsego on Monday July 10, 2023 @05:12PM
(#36673023)
I don't think there is a satisfying case for OOP.
Re:The controller pattern is awful (and other OO heresy)
by SAI_Peregrinus on Tuesday July 11, 2023 @11:27AM
(#36682350)
OOP works well when state and behavior are tightly coupled, particularly for things which are naturally modeled as state machines. Device drivers tend to be perfectly suited to OOP organization: the underlying device has state that needs to be tracked, it has behaviors which can be controlled (usually by sending particular messages), and there are often multiple implementations of the hardware which should all expose the same high-level API. OOP allows bundling the state handling with the control messages needed, exposing a single common API while allowing specialized implementations for particular driver implementations.
For the higher-level code, it's often less useful.
Re:The controller pattern is awful (and other OO heresy)
by dragonwriter on Monday July 10, 2023 @01:58PM
(#36670332)
Functional? Procedural? Logic? Dataflow? Relational? Unstructured imperative, like old-school BASIC?
I mean, the only clue we have is that it is some paradigm that isn’t OO, but that leaves... a whole lof options.