Functional bros be like

ZILtoid1991@lemmy.world to Programmer Humor@programming.dev – 293 points –
62

You are viewing a single comment

Dogmatic statements like this lead to bad, messy code. I'm a firm believer that you should use whatever style fits the problem most.

Although I agree most code would be better if people followed this dogma, sometimes mutability is just more clean/idiomatic/efficient/...

I agree somewhat, but I'd also say any codebase needs some level of "dogmatic" standard (ideally enforced via tooling). Otherwise you still end up with bad, messy code (I'd even say messier, as you don't even get consistency)

Define your terms before relying on platitudes. Mutability isn't cleaner if we want composition, particularly in the face of concurrency. Being idiomatic isn't good or bad, but patterned; not all patterns are universally desirable. The only one which stands up to scrutiny is efficiency, which leads to the cult of performance-at-all-costs if one is not thoughtful.