3 ms·
> Even factories. I meant "ignoring factories" in the sense of "practically you don't new to get an instance out of a factory, but ultimately it does that inte
by masklinn 8y ago
> Even factories.
I meant "ignoring factories" in the sense of "practically you don't new to get an instance out of a factory, but ultimately it does that internally so let's just ignore this as it's just nit-picking".
> I (unreasonably?) freak out about go because i don't understand when an array backing a slice change.
That seems like the simplest one ever: a slice is a super shitty version of an ArrayList[0], so the slice is modified on assignment (direct or via the slice), and can be replaced implicitly on reallocation. Same as the elementData member of an ArrayList.
[0] because the backing buffer can trivially be shared between slices, which is not the case for ArrayList