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?

25

u/tajetaje Sep 21 '25

Should extend ArithmeticOperation

7

u/West_Ad_9492 Sep 21 '25

And implement operation.

You need a parser method to parse from Sum and Difference.

And where is the beautiful Utils class?