4 ms·
The behavior of builtin maps can’t be customized at all. Now at least it’s possible to define a sorted or threadsafe or immutable map with a typesafe API, thoug
by erik_seaberg 5y ago
The behavior of builtin maps can’t be customized at all. Now at least it’s possible to define a sorted or threadsafe or immutable map with a typesafe API, though it takes replacing all reads and writes with method calls.
- xyzzy_plugh 5y agoNot being able to customize built-in containers is a huge win in terms of readability though. Principle of least surprise and all. If I see a map or slice I know exactly how it behaves, how much memory it consumes, what the runtime behavior is. If you make those generics instead then I have literally no fucking clue what's going on.