# Remove Enumerable#grep

**URL:** <https://forum.crystal-lang.org/t/remove-enumerable-grep/1323>\
**Category:** Crystal Contrib\
**Created:** [November 6, 2019, 10:09am UTC](https://forum.crystal-lang.org/t/remove-enumerable-grep/1323 "2019-11-06T10:09:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![j8r](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/j8r/32/111_2.png) [@j8r](https://forum.crystal-lang.org/u/j8r)\
**Post date:** [November 6, 2019, 10:09am UTC](https://forum.crystal-lang.org/t/remove-enumerable-grep/1323/1 "2019-11-06T10:09:03Z")

</div>

After reading [Can anyone explain range as array#select arguments to me](https://forum.crystal-lang.org/t/can-anyone-explain-range-as-array-select-arguments-to-me/1320/6), I learnt that there is `Enumerable#grep`.  
[Enumerable#grep(pattern)](https://crystal-lang.org/api/master/Enumerable.html#grep(pattern)-instance-method) duplicates [Enumerable#select(pattern)](https://crystal-lang.org/api/master/Enumerable.html#select(pattern)-instance-method).  
I propose to deprecate `grep`, then remove it for the following reasons:

- `select` is more widely used, `grep` is only present in this very method
- `select` is a more descriptive English word about the action performed than `grep`
- follows the least aliases principle

---

<div class="post-metadata">

**Author:** ![j8r](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/j8r/32/111_2.png) [@j8r](https://forum.crystal-lang.org/u/j8r)\
**Post date:** [November 8, 2019, 9:28am UTC](https://forum.crystal-lang.org/t/remove-enumerable-grep/1323/2 "2019-11-08T09:28:15Z")

</div>

Related PR: [https://github.com/crystal-lang/crystal/pull/8452](https://github.com/crystal-lang/crystal/pull/8452)
