# The filter function is non-intuitive

**URL:** <https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674>\
**Category:** Internals & Design\
**Created:** [August 28, 2020, 10:46am UTC](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674 "2020-08-28T10:46:47Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [August 30, 2020, 11:00am UTC](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674/21 "2020-08-30T11:00:22Z")

</div>

> [@DNF](#):
>
> What does a coffee filter let through? Coffee!

It also prevents the (ground) coffee from getting through. Filtering is so ambiguous.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 30, 2020, 1:03pm UTC](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674/22 "2020-08-30T13:03:50Z")

</div>

We could just rename `filter` to `generalized_coffee` in Julia 2.0 and be done with it.

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [August 30, 2020, 2:13pm UTC](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674/23 "2020-08-30T14:13:49Z")

</div>

I’ve always said, the one thing I’m missing from julia is that it doesn’t make my coffee. If we can get this fixed in 2.0, that would be excellent 👍

Has someone already filed an issue for this?

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [August 30, 2020, 3:12pm UTC](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674/24 "2020-08-30T15:12:58Z")

</div>

It should at least give a 418 error.

---

<div class="post-metadata">

**Author:** ![Boris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/boris/32/3306_2.png) [@Boris](https://discourse.julialang.org/u/Boris)\
**Post date:** [September 2, 2020, 7:13pm UTC](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674/25 "2020-09-02T19:13:43Z")

</div>

Apart from this not being changed in Julia and marked as “solved” I think this is personal preference. To you it might be counter intuitive, but to me it functions exactly as I expect it to be.

In music and in medicine (and more generally signal processing) a high-pass filter lets the high frequencies through, a low-pass filter lets the low frequencies through and a band-pass filter lets a specific band of frequencies through. If you ask me what I expect from an odd-number filter (the way you have written it), I would be surprised not to get the odd numbers 🙂.

---

<div class="post-metadata">

**Author:** ![koosp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/koosp/32/17186_2.png) [@koosp](https://discourse.julialang.org/u/koosp)\
**Post date:** [September 2, 2020, 9:30pm UTC](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674/26 "2020-09-02T21:30:08Z")

</div>

I’ll be repeating the sentiment of other replies, but it really is a matter of personal experience.

In astronomy filters are defined by the frequencies they let through, so it’s perfectly intuitive for me.

[Previous page](https://discourse.julialang.org/t/the-filter-function-is-non-intuitive/45674.md?page=1)
