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.
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.