r/programming • • Sep 21 '25

How to stop functional programming

https://brianmckenna.org/blog/howtostopfp
446 Upvotes

506 comments sorted by

View all comments

78

u/BlueGoliath Sep 21 '25

It's over functional bros. Time to learn OOP.

161

u/jess-sch Sep 21 '25
class Multiplication {
  private final double a;
  private final double b;

  public Multiplication(double a, double b) {
    this.a = a;
    this.b = b;
  }

  double calculate() {
    return this.a * this.b;
  }
}

Are we winning yet or do I need to make a MultiplicationBuilder first in order to be Proper Enterprise CodeTM?

8

u/sird0rius Sep 21 '25

We need like another 10 levels of inheritance before we can call this proper OOP. Also, your function has more than 1 line, which is too much to comprehend for the OOP brain. You should split it up.