3 ms·
> There are pointers without pointer arithmetic, I really don't know why they are there. Because you need some way to distinguish between having a sequence of
by jhgb 6y ago
> There are pointers without pointer arithmetic, I really don't know why they are there.
Because you need some way to distinguish between having a sequence of bytes in the middle of another sequence of bytes and having the former sequence of bytes somewhere else, at least in languages that allows both for any data type. For example, Java doesn't suffer from this since everything is pointers implicitly. And C# doesn't either because every type belongs to one of two kinds, the first kind corresponding to the former of the two cases above and the second kind corresponding to the latter. But Go doesn't have this luxury (intentionally, for the same reason as C does it).