rails/rails — comment on commit 36253916b0b788d6ded56669d37c96ed05c92c5c
File:  line 0
By sj26:

I do not like this deprecation.

The reason Memoize is complex is to satisfy all the cases we end up building into manual memoization code. They are a wonderful encapsulation of that knowledge which even a novice may use.

`... ||= ...` is not `Hash.new { ... }` is not `@... = ... unless defined? ...`, the differences of which may elude less advanced ruby developers, yet all can be simply and elegantly expressed by the memoize decorator.

One piece of knowledge in `ActiveSupport::Memoize` is that [straight hash memoization is cheaper than hash with a default block](http://stackoverflow.com/questions/5130612/different-memoization-techniques-in-ruby).

Look at [how simply it started](https://github.com/rails/rails/blob/8a9934a9d9fc98b56c4566ae2e3fd4d83e505d3e/activesupport/lib/active_support/memoizable.rb) and [the knowledge we will lose](https://github.com/rails/rails/commits/master/activesupport/lib/active_support/memoizable.rb) by removing it.