3 ms·
As a professional dev who has made a career out of working in "OOP" languages and codebases, I kind of agree. The reason why Functional Programming concepts are
by bedobi 6y ago
As a professional dev who has made a career out of working in "OOP" languages and codebases, I kind of agree. The reason why Functional Programming concepts are increasingly adopted by "OOP" languages is because Functional Programming is objectively better.
- goatlover 6y agoWhat makes functional programming objectively better? Are there studies which show this to be the case? What does better mean? Better for some people who prefer the functional approach? Better for some languages which support functional programming? Better in some situations which functional programming is well suited? Or just always better for everyone?
- bedobi 6y agoJust look at all the "OOP" languages where both the language developers and the user community are coming around to the facts that * immutability and absence of state is preferable to mutation and statefulness * Option/Maybe types (or "nullable types" which are a shoddy implementation of the same thing) are better than null * Either/Result types are better than exceptions * making things implement map, filter etc and sending in a function that describes what you want to do is better than manually eg looping through lists etc etc etc etc Anyone who doubts how endorsed this is, just read what Brian Goetz and Josh Bloch have to say about how to code in Java. Just imagine if these languages had been implemented with these ideas in mind from scratch instead of the current situation of trying to adopt and retrofit this style when the core libraries fundamentally don't support it. The current trend of "OOP" languages is basically inexorably heading towards FP and abandoning the old school "OOP" style. Eventually they will only be nominally "OOP", mostly in order to please people who have irrational attachments to labels like that, but be way more FP in nature and in all but name. For what it's worth, people shouldn't be irrationally attached to the "FP" label either. Labels aren't important - what matters is the code, how easy or hard it is to reason about it, how well it avoids entire categories of defects from even being possible etc etc. https://proandroiddev.com/kotlin-avoids-entire-categories-of-java-defects-89f160ba4671 https://proandroiddev.com/kotlin-avoids-entire-categories-of...