zlacker

[return to "Go is still not good"]
1. softwa+Hb[view] [source] 2025-08-22 11:31:25
>>ustad+(OP)
I like Go, but my main annoyance is deciding when to use a pointer or not use a pointer as variable/receiver/argument. And if its an interface variable, it has a pointer to the concrete instance in the interface 'struct'. Some things are canonically passed as pointers like contexts.

It just feels sloppy and I'm worried I'm going to make a mistake.

◧◩
2. Radioz+kU[view] [source] 2025-08-22 15:44:11
>>softwa+Hb
This confused me too. It is tricky because sometimes it's more performant to copy the data rather than use a pointer, and there's not a clear boundary as to when that is the case. The advice I was given was "profile your code and make your decision data-driven". That didn't make me happy.

Now I always use pointers consistently for the readability.

[go to top]