7

The worst thing about Java is, that it created a generation of coders, that think OOP is the opposite of FP.

Comments
  • 3
    They think that OOP is opposite to everything else
  • 4
    Correction: That don't even know what FP is.
  • 2
    With all things wrong with Java (like its OOP not even being good OOP), I think you can't blame it for this one. The misconception that OOP and FP are irreconcilable opposites is older. And with Java introducing FP concepts (while yet again poorly) it does show the opposite.
  • 1
    We built this city...we built this city on Side Effects...
  • 1
    Please explain how they're not different? (I mostly write OOP (PHP) but I'm not as familiar with FP so its also an educational question 😄)
  • 0
    @linuxxx Honestly I am learning about FP. I don't get how they are not the opposite in some ways. FP reduces side effects, OOP is side effects. FP separates data and methods, OOP marries them.

    I tried to find something that shows how they are not polar, but the more I read the more polar they look. I can see value in using FP to do certain types of data processing to allow verification/proving of correctness, but it would be mixed with OOP in most code I write. I use STL methods in C++ and those are very FP oriented, but my application structure remains OOP. Usually this is enforced by the frameworks I use. I have no interest in FP pure languages. I just don't see the point. I use lambdas all the time now as well. Generally for callbacks and minimizing of boilerplate member functions. However, those functions have side effects.
  • 0
  • 0
    ...

    I think that OOP and FP can and should be used together.

    ... I don't get the medium article at all.... For me it's like: Hey let's throw complete bogus non practical examples without any depth at the reader. Garnish it with some Wikipedia .... And done.

    ?!!

    I guess it's time I start calling my way of programming 'ACSANSWP'

    Applying common cense as needed, simplicity when possible.
  • 1
    @Demolishun
    The core of OOP is about grouping data and functionality and producing interchangeable and reusable components.
    Languages like Java turned that into Side effects, side effects and some more side effects.
    Look at Rust and Go, their OOP implementation is based on value types and members-functions instead of classes, objects,methods.
    This allows for writing completely side-effects free methods, as a method can be written as a function, that takes a copy of the value its invoked on.
Add Comment