Hacker News new | ask | show | jobs
by meaty 4916 days ago
Yes until we get to:

List<List<Tuple<int, Dictionary<string, object>, string>>>

2 comments

If you're doing that it's crap code; you should have defined a few named object types. Maybe your "Dictionary<string, object>" is e.g. actually a "PropertyMap". this is not a problem in the c# language.

See also: "primitive obsession" http://c2.com/cgi/wiki?PrimitiveObsession http://sourcemaking.com/refactoring/primitive-obsession

Not at all - you just missed a few facts that need considering. Lets rip it to bits some more:

It's in system.windows.forms isn't it? Don't really want that dependency and associated resolution being dragged in to a web app otherwise the compiler has to load the entire assembly's metadata.

Also, it requires full trust.

Oh and finally it isn't serializable.

Which is why we end up with SerializableDictionary<K, V> which is even longer and is an adaptor for Dictionary<K,V> which implements serialization.

That's why it all sucks.

And I haven't even included ConcurrentDictionary thread safety yet.

The whole thing is a fucking mess.

The typical experience isn't that bad, let alone "The whole thing is"
In my experience, that kind of stuff is usually a problem mainly because of C#'s verbosity from lack of type inference. Although, with 4 unnamed elements there, it might start making sense to create a new type, and then it's just "List<List<MyRecord>>".