Comment by grey-area
5 hours ago
Yes I'd say 0 should always be treated as a None or Invalid value.
The upside of the lack of real constructors is less incidental complexity which every object having a constructor written which then has to be read and maintained.
Another option of course is to write constructors - there's nothing to stop you doing so in go and using those when creating objects (e.g. foo.New() whenever you want one of these things), but it'd be a convention rather than something required.
No comments yet
Contribute on Hacker News ↗