News for hackers. Stuff that matters.
Re:Why We Switched from Python to Go (2021) by mb7733 on Thursday May 26, 2022 @01:04PM (#31520778)
> 1) Easy to use pointers. There's just pointers, not like C where you can have anywhere from 4 to 8 different types depending on your platform. And no, pass by reference vs. value are not the same as pointers.

Do you mean C++? Or am I confused?

Re:Why We Switched from Python to Go (2021) by snapetom on Thursday May 26, 2022 @01:59PM (#31521474)
Null, void, wild, dangling in core C. DOS also had far, near. I believe one of the Windows Visual something platforms had extensions that added another three or four.
Re:Why We Switched from Python to Go (2021) by bornfreddy on Thursday May 26, 2022 @04:36PM (#31523074)
I'll bite. So null is just a special value one can assign to a pointer, marking it not used. In Go this is nil. Void means "absence of type" and is related to pointers only marginally - void* is a pointer to something we don't know a type of. In Go, I guess a pointer to interface{} would be the same? (Not quite, but close)

As for wild and dangling pointers (I would argue the are the same - pointers that show somewhere they shouldn't), fair point. Of course one would expect this from a language so many decades younger.

But none of these are pointer "types" (far and near arguably are - iirc they determine the size of a pointer - but these four are not). I hope the question on the interviews are posed differently, I for one wouldn't know what you mean.

Re:Why We Switched from Python to Go (2021) by kaba0 on Friday May 27, 2022 @03:52AM (#31527092)
> As for wild and dangling pointers (I would argue the are the same - pointers that show somewhere they shouldn't), fair point. Of course one would expect this from a language so many decades younger.

It’s not due to age, but due to having a GC and being a managed language. I really don’t get all the comparisons of Go to C, the former seems to want to sell itself as a modern C replacement but they are nowhere in the same niche (and that’s ok, there are very few places where a GC can’t work). They just operate by completely different semantics when it comes to pointers.

Re:Why We Switched from Python to Go (2021) by lenkite on Friday May 27, 2022 @12:17PM (#31531341)
I love Golang but its pointers are awful. "Nil is not really Nil" has tripped >1M Go programmers. It's the "trillion dollar" mistake.

People make fun out of C++ all the time. Yet, Go has some extraordinary Gotchas of its own. You need to read "The Go Bestiary" to make sure you don't blow your head off.