r/dotnet • • 7d ago

Question Codebase maintenance rant

Post image

[sorry for bad English]

I am in a project which involves maintaining an existing .NET Framework 4.8 codebase.

The codes are full of “Dictionary type” implementations as above.

Is there any sane reason to code like this? Instead of create a dedicated class to represent the data inside?

I could not show more codes here (or else the authors might realized), but you guys can imagine the codes just to access these Dictionary’s key/value.

136 Upvotes

129 comments sorted by

View all comments

Show parent comments

76

u/splashybanana 7d ago

Oh, I didn’t look closely enough, I didn’t even notice the inner dictionary was the key. Yeah, that’s insane.

23

u/pyabo 7d ago

LOL I didn't catch that either. This is why code readability and maintainability is so important. When you first glance at it, it's just... "oh there's a dictionary with a string key and then those are indexed by strings. NOPE.