On Sunday, 15 November 2020 at 00:29:41 UTC, H. S. Teoh wrote:
if you don't like the semantics, don't use it; always allocate the field in the class ctor instead.

Hi, i neither like it nor dislike it - it just caught me by surprise because i was under the impression that if i create a new instance then all members get initialized according to the declared optional default value.

I can see how this is a feature - but it is also of kind "expert knowledge" and i would argue that "expert knowladge" is a designs arch enemy.

Reply via email to