Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Little to no practical use in real world for pure functional languages. Developed by mathematicians for mathematicians.
10Dev30271yCall me crazy, but OOP done right is beautiful. The idea of self-encapsulated little bits of code that contain everything they need working in harmony to form a large and complex system is art.
The idea that real-world objects can be represented in a simple and abstract way, and that software is the interactions between these objects is intuitive and straightforward.
OOP with a few functional concepts (immutable state and pure functions, for example) is an intuitive and simple way to build complex systems of software
Where OOP goes wrong is with polymorphism and inheritance and all that nonsense. OOP doesn't need that, it never has and it never will. Shitty codebases with 2000 line classes is why OOP has a bad name, but the ideas behind it aren't at fault
Mark my words, as soon as FP goes mainstream, if ever, you'll have shitty codebases in that paradigm too. It's not the ideas that determine the quality of the codebase, its the developers writing the software
Write no code.
Functional paradigm can be used in specific context for great effect - like massive parallel computing projects. but general day to day stuff like web backend, it is not flexible enough.
Try and imagine writing a Web frontend using functional.JS
If you love word "declarative", you most likely appreciate functional.
h3rp1d3v4421yPeople write crazy bs with oop. Pure functions are a lot easier to refactor
I recently read "Functional Programming simplified" which talks about wrting as functional as possible in scala.
About 2/3rds of the book were cool and seemed practical for day-to-day coding. The last part became very convoluted and seemed like it was only useful ifnyou force fully want to write pure functional. Even the simple examples became longer and more complicated than imperative counterparts.
I think no progsmming paradigm is perfect (except for very specific use cases). You should just take the best parts from each. A OOP/FP moxed language where I can choose which paradigm fits for my current use case and architecture best? Count me in.
As always take what works and ignore the rest. You don't need to use complicated monads to do what you need to do. Use boring FP parts and make what you need to make.
The funny thing with the hype over functional languages at the moment is that it's near enough *exactly* the same as the hype over OOP languages in the late 90s and early 2000s. Everyone starts talking crap about the current de facto standard, gives a few nice advantages of the paradigm they think is better, and if you dare criticise it then you must be a first class retard, there's no other explanation.
Functional languages, even pure ones, are *great* in certain scenarios. Have a stateless, naturally idempotent service? Sure, it's probably a fantastic fit. Same for OOP. Have a naturally mutating problem domain, like representing a 3D world with actual objects?! Classic fit.
In reality it's often between these scenarios of course, which is why modern languages like Kotlin let you pick and choose whatever style works best. If you think either style, or any other one, can *never* be a good fit, you're quite simply wrong. It's that simple.