4 ms·
`Dictionary<List<Dictionary<string, object>>>, SortedSet<Dictionary<int, string>>>>` This is not a problem with generics, but with C#'s lack of discriminated u
by Smaug123 6y ago
`Dictionary<List<Dictionary<string, object>>>, SortedSet<Dictionary<int, string>>>>`
This is not a problem with generics, but with C#'s lack of discriminated unions and/or tiny-types. Except what on earth are you doing with a dictionary whose keys are lists of dictionaries? I am quite sure someone has not modelled their domain correctly there. That's not something you can blame on the existence of generics - I shudder to imagine how much worse it could have been without generics!
- uncledave 6y agoI was exaggerating there I admit, mostly because I can't post some of the hell I've seen without breaking contracts. The worst example I've seen was a completely generic data type specified abstract syntax tree. I spent a couple of weeks rewriting that using concrete types and managed to find and fix tens of trivial bugs caused entirely by the design. The point is really that it's hard to reason about such things and define if they are appropriate or not for a lot of people. It's a lot of rope to hang yourself with.
- a1369209993 6y agoThe sufficiently stupid-but-hard-working programmer can write crap code in any language. The actually-useful question is whether the language gives competent programmers enough rope to build whatever they're trying to build.
- uncledave 6y agoWe shouldn’t build stuff for the 5%
- marcus_holmes 6y agoI think the answer for that for Go is "yes"
- swirepe 6y ago> I shudder to imagine how much worse it could have been without generics! It probably would have just become a very long String pretty early on. It would have xml in it, but not always, because nobody is that lucky.