Re:The controller pattern is awful (and other OO heresy)
by afiori on Tuesday July 11, 2023 @08:53AM
(#36680283)
Having a class whose only purpose is to have a run method feels like writing () => 2
Re:The controller pattern is awful (and other OO heresy)
by 000ooo000 on Tuesday July 11, 2023 @11:38PM
(#36690216)
Do you put all of your source code files in 1 folder?
Re:The controller pattern is awful (and other OO heresy)
by afiori on Wednesday July 12, 2023 @06:31AM
(#36692567)
I am confused on the relevance of this question
Re:The controller pattern is awful (and other OO heresy)
by 000ooo000 on Wednesday July 12, 2023 @06:51AM
(#36692697)
My obtuse point is that though sorting your source code files into various directories offers no functional benefit*, some folk find it useful from an organisational perspective. Maybe there's an element of that in housing functions an object.
*bear with me - admittedly there are languages/technologies where directory structures are required, but hopefully you get my point.
Re:The controller pattern is awful (and other OO heresy)
by afiori on Wednesday July 12, 2023 @08:15AM
(#36693420)
My point was that if a function in your language is
class {public function call() {...}}
then it is going to be unergonimic to write what other languages write as array.map((elem)=>{...})
Re:The controller pattern is awful (and other OO heresy)
by JoeNr76 on Wednesday July 12, 2023 @04:31AM
(#36691814)
You can use verbs passively to do something on something else. Or you can have your program or process do it. Logically, I see no difference between:
"The HandlerCreationFactory created a Handler based on the Request." (oop)
"A Handler is created based on the Request." (passive) or "The program (or process) creates a Handler based on the Request. "
Only that the first one needs a lot more nouns, even when they look silly.
Re:The controller pattern is awful (and other OO heresy)
by StackOverlord on Wednesday July 12, 2023 @09:28AM
(#36694221)
Inform7 Actions and Rules system made me reconsider the centrality of the notion of Object when it comes to dispatching (note: Inform7 reads like english). Inform7 takes a verb-centric stance, then consider the subject (i.e. "this", in OOP), then the object (i.e. the arguments to a method). You can inject more specific behaviors in an action (i.e. something akin to a multimethod in CLOS), by adding an adjective to a verb/method complement/arguments. You can even use adjectives on the verb/sentence. All of this is gathered within a rulebook associated with the verb that exists aside of the actual source code: you can write code linearly, following the natural order of a given user story from the domain you model, using multiple verbs in succession, but can still display all a verb's rule, encompassing many user stories. Most importantly, it is truely extensible because you can't add code to an action's rulebook without doing so through a rule, which has the same role as a junction-point in aspect oriented programming or even subject-oriented-programming.
https://en.wikipedia.org/wiki/Subject-oriented_programming
https://en.wikipedia.org/wiki/Aspect-oriented_programming
(Please don't take this comment as an endorsement of OOP as practiced in the corporate world or that traumatic memory you have of an OOP codebase.)