3 ms·
> Foo foo = new Foo(); The Golang FAQ calls that stuttering; good term, I thought. https://golang.org/doc/faq https://golang.org/doc/faq See section: What
by vram22 9y ago
> Foo foo = new Foo();
The Golang FAQ calls that stuttering; good term, I thought.
https://golang.org/doc/faq https://golang.org/doc/faq
See section:
What are the guiding principles in the design?
"Stuttering (foo.Foo* myFoo = new(foo.Foo)) is reduced by simple type derivation using the := declare-and-initialize construct."
- JoeAltmaier 9y agoOr my favorite, for declaring/initializing static members: Foo::Bar *Foo::foobar = new Foo::Bar(Foo::Bar::FOOBARENUMVALUE);