4 ms·
Constructors are easy to write in GO: Maybe I didn't clarify it enough, but I tried to explain my problem with initialization functions in the "Future-proofing
by munificent 16y ago
Constructors are easy to write in GO:
Maybe I didn't clarify it enough, but I tried to explain my problem with initialization functions in the "Future-proofing" section: "If you later need more complex initialization, you’ll have to replace every new(Foo) call with NewFoo()."
An exception-like mechanism has been proposed:
Yes, and implemented and put in the language and referenced in the post. I'm not crazy about panic and defer for reasons spelled out a bit here: http://www.reddit.com/r/programming/comments/du9zu/the_language_i_wish_go_was/c12zamo http://www.reddit.com/r/programming/comments/du9zu/the_langu...