Taking the Functional Programming red pill

How do you go back to writing procedural/Object Oriented code after diving down the rabbit hole of functional programming? So many things are just so much more elegant.
Things that take a few lines of code in a language like f# or Haskell can take upwards of dozens to a hundred lines of boiler plate code with mutable state all over the place in an OO language. If was forced to work in some code monkey language like golang I would want to jump out a window from how dull it is.

I'm working on a Java codebase right now. Java at least has some facilities for functional programming like functional interfaces, lambdas and streams. My manager is deeply rooted in everything OO, deep class hierarchies, mutable state everywhere, hundreds of files littered across dozens of directories that could be replaced by a fraction of the amount of code with a functional approach. I try to use streams, optional types, lambdas, static pure functions etc. as much as I can but he just shoots them down in code review because they don't meet the "style guide" of the project.

How is OO programming, especially strict OO like Java that forces everything into a noun still so popular?

Attached: 1200px-Haskell-Logo.svg.png (1200x847, 15K)

Other urls found in this thread:

youtube.com/watch?v=4jh94gowim0
twitter.com/SFWRedditGifs

inertia

all the boomers are still OO programmers

all the educational materials are still about OO

all of the cruft of OO like UML diagrams and thousand-line class definitions make middle managers happy because it looks like people are doing work

the only thing that talks with force is money, and functional houses are way smaller and can scale way bigger, as discuck and others have shown

You leave that project. I'm in your same shoes except we don't ever do code review lmfao. It's up to you and me to study leetcode and join a real company that cares about this shit.

You might know how to code, but corporations which push the intertia of a lot of this stuff, they suck dick at programming.

Why, just write small pure function and package them in a lib.

logically isolate stateful code by using naming a convention

pass contexts around (I will degenerates could get the beauty of implicits -the second only innovation in PL after Type classes which actually are type-traits) instead of global variables

actually, mostly-functional approach popularized by Scheme will be fine

and, of course, you need no fucking monads in a strict language

/thread

You can still program in functional programming language and object orientated programming; see Scala and OCaml.

Not when the coding guidelines are completely retarded crap that was barely acceptable 20 years ago.

Quit your job
But seriously, ask for a transfer to another team, push to start a project in scala or clojure.
Consider sleeping with your boss to make him see things your way?

I don't think either of those are done favours by their OO features.

considering JVM in 2019. idiots, idiots everywhere

you should even suggest typescript

>Scala
So successful, it's biggest contributor rage quit precisely because the scala community were killing the FP part in favor of insane OOP lunacy.
youtube.com/watch?v=4jh94gowim0

Most of his rant has either been fixed or will be fixed in dotty.

>It's up to you and me to study leetcode and join a real company that cares about this shit.
Which companies are those? If I knew beforehand I would apply to them, but there's no way to really know unless you go through an interview process which takes a lot of time.

So Scala fixed all its insane type abstractions and no longer has a split and fragmented community?
And Scalaz is now in the standard?

why that fucking hipster is barefoot? does he imagine himself as a yogin or a baba? some kind of a lifted spirituality over a mundane world?

OOP if for brainlets who can't reason about abstractions and mathematics that need to think about objects to create simple stuff.

Based

he's trying to have a beach vibe its hot in summers bro

a. The JVM isn't terrible, it just has a bad rep because it's tied to Java, but in itself it's a good piece of engineering. Yeah it isn't as fast or memory efficient as C, we know.
b. Consider the setting. Organizations are afraid of change. If you tell them they can keep their precious JVM and run regular jar they're more likely to agree, yes?
c. typescript
Heaven forbid

K O T L I N

Funny you say that, but he still thinks that Scala is the best tool out there, he is just an idealist and perfectionist.

Because he cares more about his own comfort than your dress code.

Why did he stop writing scala code then?

When did he say that? In any case he probably stopped writing code in every language because he is autistic and wants to create the perfect language.

>he is autistic
Autism and retardation aren't the same thing. And only the latter could cause someone to write Scala of their own will.
>wants to create the perfect language
It already exists. It just has a natural pleb-filter barrier around it.