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

This commit has just hit the release notes for Rails 3.2.

I can't see how `ActiveSupport::Memoizable` can be deprecated in favour of `@var ||= ...`; they're not equivalent.

`ActiveSupport::Memoizable` nicely packages up some logic which is tedious and error-prone to repeatedly implement. It correctly memoizes non-true values (nil, false etc) and varies memoization by method parameters. As a bonus, it keeps cached return values separate from actual instance state; two distinct types of data.

Removing `Memoizable` would be like removing `ActiveSupport::Concern` - the same result can be achieved by "simply using Ruby", but it's a valuable part of ActiveSupport.

Cheers,
Paul