News for hackers. Stuff that matters.
Re:Rust is surprisingly expressive by Touche on Saturday December 28, 2013 @05:08PM (#6976866)
It's non-obvious to me what 2.days() returns, that's the problem.
Re:Rust is surprisingly expressive by matthewmacleod on Saturday December 28, 2013 @05:32PM (#6976953)
I don't think that's a problem: avoiding features or fiddling with syntax in order to make the code more accessible to people who are not familiar with the language or its libraries isn't going to gain much in the long run. Languages and libraries should be geared towards long-term developer happiness, rather than a shallow learning curve.

Anyway, I know as close as possible to nothing about Rust. It seems blindingly obvious to me that `2.days()` returns some kind of duration, and `2.days().from_now()` returns some kind of time. So I've looked at the code, and that appears to be correct - `2.days()` returns a `TimeChange`, and `2.days().from_now()` returns a Time. I can't think of any other reasonable interpretation.

Re:Rust is surprisingly expressive by ivanca on Saturday December 28, 2013 @05:43PM (#6976997)
Yeah, you _had_ to look at the code to realize that; when it could have been

     new TimeChange.fromString("2 days from now")
Which would have been more helpful for actual development, not only for a dumbed-down syntax aiming for easier comprehension.