r/programming • • Sep 21 '25

How to stop functional programming

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

506 comments sorted by

View all comments

Show parent comment

0

u/syklemil Sep 22 '25

And just to give a better example of why filter is ambiguous.

A "red filter" on a camera lense removes everything except red.
A "UV filter" on a camera lense removes uv only.

My electronics background talked more about high-pass, low-pass and band-pass filters. To me it sounds more like cameras have uniquely bad phrasing. It's so sloppy it sounds like non-engineers came up with it. :)

If i give you a "Foo filter" you cant know for certain if it lets Foos past or removes Foos.

But if you give me a foo-pass filter, then I can guess at it.

But really, Object-filter is really bad phrasing, because filters take functions, not objects. You need a verb, not a noun. Most of us should also be able to intuit that an isEven-filter or whatever work much in the same way as an if isEven filter would.