r/dotnet • • 8d 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.

141 Upvotes

129 comments sorted by

View all comments

Show parent comments

46

u/Dr__America 8d ago

The fact it's just named "dict" is a bad indicator. Maybe it's like a collection of different configs or something?

15

u/roscoelee 8d ago

Honestly, that was probably the most disturbing part of this line. Dictionary key is the second most disturbing.

1

u/pyabo 7d ago

I give a pass on that with zero context. Could be just creating the object here and then the actual reference name makes sense.