3 ms·
"In some ways, they are the holy grail of concurrent data structures. On the other hand, a concurrent hash table is an inelegant blob of shared mutable data, of
by gleenn 2y ago
"In some ways, they are the holy grail of concurrent data structures. On the other hand, a concurrent hash table is an inelegant blob of shared mutable data, often a marker of a poorly architectured program."
I find the last bit particularly objectionable. If you're in some language slanging objects around all day, then sticking a untyped, bespoke substitute for an object probably isn't the right move. But on the long path down my programming career, I recognize objects make so many things harder and more confusing than necessary. I definitely prescribe to Rich Hickey saying I would rather have 1 data structure and 100 functions that operate on it far easier to work with and understand than 10 data structure and 10 functions. Clojure absolutely is a joy to work with and reason about, and it only gets better the faster you get out of typed object land. Hashmaps are the purest abstraction over an associative data structure, and I will take one over a pile of classes with brittle, snowflake interfaces any day.
- magicalhippo 2y ago> classes with brittle, snowflake interfaces That is exactly the opposite experience that I have, to the point I feel like it's from a different universe. Perhaps difference in domain, but every time I have to use Python or JS I hate the lack of explicit types with defined interfaces as discoverability during coding is zero. And you end up with code that, after dependency updates or similar, you never know if it'll crash until you run it.
- froh 2y agoin my experience there's always so much more to data structures that you can shoehorn into member functions. I agree type hints are a godsend for discoverability, but please, show me all operations this type can be a parameter for. I want "discoverability" on the argument lists of all libraries. and I find lsp with type hints useful for that. and multi methods! can I have multiple dispatch? but first parameter based dispatch "oop" only? meh.