No, it's not the case and this terminology shouldn't be used as it's confusing and unhelpful.
There are reference types in Go even though this is also not a super popular term. They still follow the pass-by-value semantics, it's just that a pointer is copied. A map is effectively a pointer to hmap data structure.
In the early days of Go, there was an explicit pointer, but then it was changed.
Slices are a 3-word structure internally that includes a pointer to a backing array and this is why it's also a "reference type".
That said, everything is still passed by value and there are no references in Go.
foo is receiving a mutable reference and it can't modify the map without those changes leaking out permanently to the caller: https://go.dev/play/p/DXchC5Hq8o8. Passing maps by value would have prevented this by copying the contents.
It's a quirk of C++ that reference args can't be replaced but pointer args can.
The point is that the local variable referencing the map is a different entity than the map itself. Foo gets a copy of that local variable, and the copy references the same map object.
And the fact that C++ references can be used for assignment is essentially their whole point, not "a quirk".
> rsc, thank you very much for all the hard work on the language that brought me into software engineering.
You're quite welcome, and thank you for this comment. I never expected when we started that Go would have such a positive impact on people's lives, bringing new people into programming and software engineering. That's definitely the impact I'm most proud of.
Thank you guys from another fan! Go literally saved my career as a software dev: got burned out around 2014, tried Go as therapy and have been a happy gopher ever since :)
Thank You rsc. This is sad because Go is one of the few language that is good and conservative instead of hype and feature creep. And that is primarily because you say No to a lot of things.
I do wonder, if you could re-do Go or another programming language again. What feature / changes would you add or take out.
I've been programming for 20 years and Go has proven to have more gravity than any other language I've used. When I just need to get something done, it's what I reach for. Thank you for your part in building such a useful tool.
Thanks for helping the OEIS site stay alive. I was absolutely delighted by it the first time I visited it, decades ago. Equally delighted when I visited recently and saw some “Russ Cox” contributed.
Same sentiment as the above poster. I’ve been working with Go since 2014, after using many languages before, and none match the ease and efficiency of development for my work. Thank you so much!
Co-author of the book here. Thanks for the comment. I agree, it does seem surprising to miss NAT. I opened an issue (which we will address at some point): https://github.com/SystemsApproach/book/issues/75
That echoes my experience as well. Also, I have noticed that at least for me Tinder has been very strange in that it keeps showing the same profiles every day, most of which are fake anyway.
It became so absurd that even IRL it's much easier to meet someone and start a conversation than on the app that was literally created to simplify that.
I think I have a somewhat similar case. Whenever there's an important or interesting task at work, it's literally impossible for me to distract and stop before it's done. I can skip my dinner and sleep because my mind is fully focused on the task. Because of that, I can also do a lot.
On the other hand, I cannot watch movies or read books because my mind wanders every second and it's really hard to concentrate.
Martin Kleppman, best known as the author of the fantastic book Designing Data Intensive Applications, talks about modern data systems, his current work on collaborative software and, most interestingly, the second edition of DDIA.
He mentions that in the new edition, there will be more information and focus on cloud services, and some "dead" technologies like Hadoop MapReduce will be omitted.
In general, however, Martin is happy that most of the book is still fundamental knowledge and ages pretty well.
A bit not as well known is the fact that Martin is doing research in collaborative, so-called "local first" software (think, CRDT) where local devices play the central role.
In general, I think Martin Kleppman is a terrific writer and teacher.
The expected release date is December 25