Go structs are copied on assignment (and other things about Go I'd missed)
1–10 of 176 posts
Re: Go structs are copied on assignment (and other things about Go I'd missed)
#2Then read the [Go Language Specification][1] cover to cover. It's dry but refreshingly not legalese.
Re: Go structs are copied on assignment (and other things about Go I'd missed)
#3Does this trip anyone else up? I found it unenlightening / unsurprising, and the linked "100 mistakes" piece also very basic and in some cases just plain wrong.
Re: Go structs are copied on assignment (and other things about Go I'd missed)
#4Re: Go structs are copied on assignment (and other things about Go I'd missed)
#5Re: Go structs are copied on assignment (and other things about Go I'd missed)
#6Misconceptions probably come from Java or Python where a bunch of things are implicitly done for you. I much prefer Golang’s explicitness. The stuff with slices are confusing though
Re: Go structs are copied on assignment (and other things about Go I'd missed)
#7Misconceptions probably come from Java or Python where a bunch of things are implicitly done for you. I much prefer Golang’s explicitness. The stuff with slices are confusing though
Re: Go structs are copied on assignment (and other things about Go I'd missed)
#8Misconceptions probably come from Java or Python where a bunch of things are implicitly done for you. I much prefer Golang’s explicitness. The stuff with slices are confusing though
Still, as far as sharp edges go these are nothing compared to Java.
See the discussion from:
Common I/O Tasks in Modern Java
https://news.ycombinator.com/item?id=41142737
House of horrors, especially the URL equality triggering DNA requests.
Re: Go structs are copied on assignment (and other things about Go I'd missed)
#9Not understanding structs vs pointers is a pretty basic misconception in go. Does this trip anyone else up? I found it unenlightening / unsurprising, and the linked "100 mistakes" piece also very basic and in some cases just plain wrong.
Which of those 100 mistakes were "plain wrong"? That would be useful feedback for the author.
Re: Go structs are copied on assignment (and other things about Go I'd missed)
#10If she didn't understand it, I can 100% guarantee that there are large numbers of people out there who also didn't understand it - many of whom were probably too embarrassed to ever admit it.
I think this is a useful trait for senior software engineers generally. If you're a senior engineer you should have earned enough of a reputation that the risk involved in admitting "I didn't know that" can be offset by everything you provably DO know already. As such, you can help everyone else out by admitting to those gaps in your knowledge and helping emphasize that nobody knows everything and it's OK to take pride in filling those knowledge gaps when you come across them.