this post was submitted on 28 Oct 2024
504 points (98.3% liked)

Programming Humor

2644 readers
184 users here now

Related Communities [email protected] [email protected] [email protected] [email protected]

Other Programming Communities [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 15 points 2 weeks ago (8 children)

There's literally nothing related to OOP in this snippet.

[–] [email protected] 5 points 2 weeks ago* (last edited 2 weeks ago) (6 children)

You're right, this is just not oop AT ALL.

For the correct OOP solution, you would need consider whether this can be thought of as a kind of stateless leaf method, and therefore implement it as an abstract (singleton) factory, but on the other hand, if you're using a context object with the registry pattern, you should probably do this properly with IoC containers. Of course, if your object graph isn't too complex or entangled, you could always just do constructor injection but you risk manging your unit tests, so I would go cautiously if I were looking in that direction.

[–] [email protected] 5 points 2 weeks ago (2 children)

Shouldn't there be a call to the boolean comparison microservices server in there somewhere? Also, we should consider the possibility that booleans and their operators could be overloaded to do something else entirely. We might need a server farm to handle all of the boolean comparison service requests.

[–] [email protected] 4 points 2 weeks ago

You're so right, I didn't think of that. Maybe I'm not cut out to be a manager in IT.

load more comments (1 replies)
load more comments (4 replies)
load more comments (5 replies)