Re:Rust is surprisingly expressive
by matthewmacleod on Saturday December 28, 2013 @05:38PM
(#6976977)
That's kind of the philosophy of Ruby though, and ActiveSupport by extension.
Where it makes code clearer and more concise, or where it simplifies an often-used idiom, and where it outweighs the benefit of sticking to principles—as I believe it does here—then breaking those principles is acceptable, in languages where coding conventions support this.
Re:Rust is surprisingly expressive
by philwelch on Saturday December 28, 2013 @08:29PM
(#6977689)
I don't think `2.days.ago` makes code any clearer or appreciably more concise than, for instance, `Date.today - Date.days(2)` (or even, to meet you in the middle, `Date.today - 2.days`).
Where it makes code clearer and more concise, or where it simplifies an often-used idiom, and where it outweighs the benefit of sticking to principles—as I believe it does here—then breaking those principles is acceptable, in languages where coding conventions support this.