News for hackers. Stuff that matters.
Re:Java 8: No more loops by TheLoneWolfling on Monday January 12, 2015 @12:09PM (#8874984)
And this is one of the major reasons why Java is regarded as verbose. There's a simple solution (have the compiler transparently rewrite references to x.foo to x.getFoo / x.setFoo and transparently add getFoo/setFoo - the JVM inlines (trivial) getters and setters anyways) and yet Java, in the interests of "transparency", doesn't allow it.

And their justification fails. Sure, currently if you read x.foo you know that no code is being executed - but you never see x.foo because everything has getters and setters. So all it does in practice is make things (even) more verbose.

Re:Java 8: No more loops by 0942v8653 on Monday January 12, 2015 @12:49PM (#8875244)
That's one of my favorite things about Swift. I can do, for example:

    // version 1
    var author: String

    // version 2
    var author: String {
        get {"\(authorFirst) \(authorLast)"}
    }
Re:Java 8: No more loops by robwilliams on Wednesday January 14, 2015 @12:55PM (#8887853)
C# as well. C# 6 is very concise.