News for hackers. Stuff that matters.
Re:Rust is surprisingly expressive by MichaelSalib on Saturday December 28, 2013 @03:20PM (#6976320)
I feel the same way that hamburgler does. For me at least, you java calendar code looks horrible. I'm thinking something more like

    date.today() - timedelta(days=2)
Re:Rust is surprisingly expressive by matthewmacleod on Saturday December 28, 2013 @04:53PM (#6976799)
Note that this syntax is perfectly achievable in Ruby (w/ActiveSupport) too. The following expressions are equivalent:

  Time.now - 2.days
  Time.now.advance(days: -2)
Re:Rust is surprisingly expressive by MichaelSalib on Saturday December 28, 2013 @04:57PM (#6976816)
If you can get exactly the same benefit, then why pay the cost of overriding behavior of the integer type and dealing with hidden black magic that makes your program harder to reason about?
Re:Rust is surprisingly expressive by steveklabnik on Saturday December 28, 2013 @05:06PM (#6976849)
I'm not sure which example you're talking about, but there's no additional cost in the Rust example. And it's not hidden; it's in the trait definition, which is scoped.