3 ms·
I agree. For the most part, I rarely use anything but slices ("dynamic arrays"). Once in a while I'll use a map, but only for large Ns, since maps don't have us
by throwaway894345 6y ago
I agree. For the most part, I rarely use anything but slices ("dynamic arrays"). Once in a while I'll use a map, but only for large Ns, since maps don't have useful zero-values and they tend to incur more allocations (which are relatively expensive in Go) than slices (and generally lookups are slower for small N values).
- emodendroket 6y agoI thought dynamic arrays might be a more recognizable term to people who aren't already Gophers.
- throwaway894345 6y agoFor sure; I wasn't trying to correct you--I just used both terms for clarity.