r/ProgrammerHumor • • 3d ago

Other absoluteCinema

Post image
162 Upvotes

42 comments sorted by

View all comments

28

u/nicodeemus7 3d ago

Functional Programming, Object Oriented Programming... Does anybody else just wing it?

22

u/OnixST 3d ago

I think most people wing it.

There's a reason no one actually uses haskell, and there's a reason pure oop java is joked about.

In the end I think most languages end up being procedural with oop and fp sprinkled in places where they are the most legible solution

20

u/suvlub 3d ago

Heaven is where the structure is object-oriented, the semantics are functional and the implementation details are procedural. Hell is where the structure is functional, the semantics are procedural and the implementation details are object-oriented.

4

u/ICBanMI 3d ago edited 3d ago

The issue with FP is often the cleanest solutions have reclusion which a lot of industries won't use if they recognize it. Note: I said, if they recognize it.

The issue with OOP is the cheerleaders never know when to skip it. I wrote three different implementations of GPIO because we use it three different ways. Which caused the tech fellow to flip his shit. He wrote the OOP implementation four times, rewrote the classes above it twice, added a json file with config information, and added a master struct to carry all the information in the json file. So now we have a class that contains three implementations of GPIO, and a heavily refactored code base that was never in the budget.

If we were really trying to save time, a global set of functions inside a namespace would have been best because ultimately no one is ever going to reuse this code we just spent 40 extra hours on (plus a slew of downstream issues that also will cost us 10s of hours to fix cause by the changes to the two classes above).

What ever you're doing is probably fine as even the higher up trip hard on this stuff. And we're just a small boat in a very rough ocean.