So would you recommend to always embed struct and not pointer to struct?
Huy Giang
11

Embedding is generally preferred although it has its trade offs. Embedding means that the parent object cannot be garbage collected as long as there’s a reference to the embedded object. Sometimes you don’t have a clear owner of some data so in those cases it can make sense to have it on its own.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.