A new syntax for declaring the “set” operation visibility of an object property
Chain method on newly created objects without parentheses
I think this syntax is not good. Just quickly scanning the code visually might give you a wrong impression if you just see the keyword private
.
I prefer the syntax of kotlin a lot more which would look like this:
class Foo { public string $bar = 'baz' { private set; protected get } }
For some reason this website messes with the markdown. Image the additional two lines for the setter and getter both to be indented one more time than the public
keyword. So with a total of 8 spaces in front.