Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
metamourge850425dFor sucks sake.
Every fucking month a scumbag that doesn't know shit posts something about OOP vs FP.
Wanna know what?
THERE IS NO VS!!!
OOP and FP cover completely different issues and don't interfere with each other in any way.
This garbage is usually posted by shitcoders who only know Java and now think that every language abides its shitty design.
OOP is about relation between functionality and data.
FP is about handling of data.
I'm very much able to write object-oriented, functional code.
arvx5825dOOP is not garbage and FP is not the all new shiny replacement either. They both have valid use cases and are meant for different purposes. Consider F# and GoLang, they are multi-paradigm languages that can leverage both OOP and FP styles. I generally find that OOP allows me to better organize my code into a natural structure. People who diss OOP are quite ignorant of how to properly leverage it.
Also, when coding in OOP not everything is an object, you also have static classes and structures etc.
AlmondSauce787225dEvery decade or 2, someone always comes out with "Hey, paradigm X that we've all been using so far is crap, we should use paradigm Y for everything instead!"
Most lately, X has been OO and Y functional.
The reality is that different paradigms are suitable for different purposes, which is why there's very few "pure" real world languages in use. If you want to be good, learn OO, imperative, reactive, functional, etc. and learn where they fit best.
SomeNone70825dThe reality is that OO would be a good solution for modelling stuff… if it weren't for the large amount of useless programmers that write 80s-style imperative code with 95% global variables inside a thin wrapper of OO classes, then half-heartedly refactored to the latest and greatest Enterprise-y mix of design patterns.
Since the resurgence of functional programming is relatively new, I haven't yet seen as many questionale implementations using (or trying to use) it, but I'm sure that 10 years down the river we will slap our faces with our palms just the way we do nowadays when coming across another OO fuckup.
VaderNT168823d> if it weren't for the large amount of useless programmers that write 80s-style imperative code with 95% global variables inside a thin wrapper of OO classes
You just reminded me of one of the worst cases I've ever seen. Basicaly, a coworker had encoded a state machine using an enum, a handful of global booleans, and one huge-ass process() function with a seemingly endless chain of if-else clauses.
Of course she didn't have to maintain it, because that was the trash code she rushed out the door before going on an extended vacation. No test coverage. "I manually clicked through the process, it works!" - it didn't. Almost all error cases were broken and the code was so brittle it fell apart if you looked at it with both eyes at the same time.
I liked her as a person, but boy was her code always a dumpster fire. She shouldn't ever have been promoted beyond junior.