1 point

This is your brain when you OD on OOP.

permalink
report
reply
15 points

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

permalink
report
parent
reply
5 points
*

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.

permalink
report
parent
reply
4 points

I was just thinking it needed more factories

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply
5 points

I love how OOP devolves into shoving code up it’s own ass.

permalink
report
parent
reply
1 point
*

I know. I didn’t say this was OOP, I said this was your brain when you OD on OOP. While we are not dealing with objects, I’d argue that the kind of approach that would lead one to needlessly overcompartmentalise code like this is the product of having a little too much OOP.

permalink
report
parent
reply
1 point

Don’t do OOP kids

permalink
report
reply
1 point

Not even once

permalink
report
parent
reply
10 points

That’s not OO code

permalink
report
parent
reply
0 points

Still good advice, though.

permalink
report
parent
reply
2 points

Not really. Good advice would be to use the right tool for the job

permalink
report
parent
reply
5 points

WTAF? Is this written by a hallucinating AI?

permalink
report
reply
3 points

I think it’s a joke (maybe)

permalink
report
parent
reply
2 points

I don’t think this is the sort of error an AI would make.

permalink
report
parent
reply
1 point

I’ve asked ChatGPT to create boiler plate code and it will offer these nested functions so you can change the logic in the future. It’s not smart enough to ask why you’re doing something a particular way or suggest a better alternative.

permalink
report
parent
reply
9 points

!NOT

Who’s there?

!!Naughty Knots

permalink
report
reply
34 points

“You aren’t writing enough lines of code!” - Management

permalink
report
reply
8 points

My boss’s boss, a former Ops manager who liked to keep track of system stats, once asked her why the CPU usage on the dev box had decreased that month. Weren’t the devs doing any work?

permalink
report
parent
reply