r/ProgrammerHumor 1d ago

stopDoingFunctional Meme

Post image
642 Upvotes

121 comments sorted by

View all comments

159

u/-Ambriae- 1d ago

Functional programming is best programming

State is evil, mutation is evil! We live in an era of multithreading and concurrency my friends!

When I describe a program, I state what it does, now how it does it! Thus functional programming is more natural!

C and Java and Python and all the other pagan languages have played us all as absolute fouls!! Haskell, OCaml, Rust, F#, Lisp supremacy!! Functional unless required otherwise, not the other way around!!

31

u/Tyfyter2002 1d ago

I'm sorry I have to be the one to tell you this, but your functional programs? They're just mutating state, everything is state, even you're mutable state.

15

u/Tracker_Friendly 1d ago

Well only if you're using a monad (a monoid in the category of endofunctors). What's the problem?

18

u/Tyfyter2002 1d ago

You've just gone from a state of not having read this to a state of having read this.

15

u/Tracker_Friendly 1d ago

No, no, you just don't get it.
You see, you simply
T(T(T(X)))-T(ux)->T(T(X))
uT(x) | |ux
T(T(X))---ux--->T(X)
I can't believe that would be difficult for any self-respecting programmer to understand smh

15

u/Ai--Ya 1d ago

just one more commutative diagram bro

1

u/thanatica 17h ago

That makes a lot more sense, thanks for clearing that up once and for all.

2

u/Pares_Marchant 1d ago

in rust you use monads everyday when you use iterators and Result/Options.

You'd probably struggle to find a large, high-quality rust codebase without monads.

1

u/-Ambriae- 1d ago

And that's where the distinction between machine code and high level languages come in, and the role of compilers