What on earth does he mean by saying that "the reduce method [instead of inject] is performance friendly and a more "Ruby way" of doing things"? `reduce` is an alias for `inject`...
Based on the linked github page[1], it looks like that comment was an extrapolation from a guideline in Airbnb's Ruby Style Guide, where Airbnb prefers the use of `reduce` instead of `inject`:
- Prefer `reduce` over `inject`.
I haven't seen any other evidence to show reduce is more performance friendly.
- Prefer `reduce` over `inject`.
I haven't seen any other evidence to show reduce is more performance friendly.
[1]: https://github.com/airbnb/ruby#collections