3 ms·
From my experience Go's array (slice) is a far better solution. It does not only carry the size (number of elements), it also carries the array buffer capacity.
by chmike 8y ago
From my experience Go's array (slice) is a far better solution. It does not only carry the size (number of elements), it also carries the array buffer capacity. To me it's the epitome of what arrays should be.
- zaphirplane 8y agoUsually people have to refer to a slice cheat sheet to work with it, perhaps it’s not an intuitive concept/api
- burntsushi 8y agoThat's because of a lack of named methods to perform common operations. It has nothing to do with the fact that slices are fat pointers. Also, nobody I know constantly looks at a cheat sheet. The concepts motivating the various slice transformations get ingrained pretty quickly.