3 ms·
It’s the complete lack of magic. What you see in front of you is pretty much exactly what happens. You don’t have to keep a cathedral of language semantic subtl
by teeray 3y ago
It’s the complete lack of magic. What you see in front of you is pretty much exactly what happens. You don’t have to keep a cathedral of language semantic subtleties in your head when reading someone else’s code.
- kaba0 3y agoThen why don’t we go back to assembly? There is even less magic there, every line is trivial to understand, isn’t it?
- deleted 3y ago[deleted]
- rochak 3y agoPointer vs value receivers and named returns have so many gotchas that it is not even funny. Lack of magic my ass.
- asylteltine 3y agoCan you name any? I have never seen a “gotcha” because it’s just explicit… it’s not like you are surprised by a pointer.
- teeray 3y agoThe way you avoid these are twofold: 1) Use the pointer receiver unless you have a really good reason to do otherwise. 2) Never, ever use named returns. Code can (and should) always be written to not use them.
- ssd532 3y agoCan you elaborate point 2, please?I am wondering how is that related to the issue of pointer and value semantics.