News for hackers. Stuff that matters.
Re:Why I Don't Like Golang (2016) by Boxxed on Wednesday June 12, 2019 @07:56PM (#20170577)
> Why do we need both . and -> ? The compiler is always able to know which one makes sense from the type of the variable anyway.

I've often wondered this myself. The best I can come up with is that the underlying code generation includes an additional dereferencing step with ->, so having both . and -> makes the compiler a little more transparent.

Of course, in C++ you really need both because overloading -> is nice for e.g. objects that want to look like pointers.

Re:Why I Don't Like Golang (2016) by jkoudys on Thursday June 13, 2019 @04:31AM (#20172782)
This was solved in rust by approaching it from the other side. You need to be explicit everywhere that a value is "borrowed", so while you never need a `->`, you'll still know it's dereferencing in the more natural place - before the variable, not as an implied step after.
Re:Why I Don't Like Golang (2016) by paulddraper on Thursday June 13, 2019 @12:39AM (#20171839)
My guess is they liked the explicitness of it.