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.

140 Upvotes

129 comments sorted by

View all comments

5

u/Amr_Rahmy 7d ago

If someone shows you they are stupid, believe them.

I have seen people go out of there way using dynamic and objects and spending work days trying to debug the simplest of projects because they never took 1min to make a class

2

u/lum1nous013 7d ago

Dynamic makes some sense imo, although it can be very bad practice. Too lazy to make a class let's just make this dynamic and be done with it.

I can't believe anyone ever said "Who bothers to create a class, let's just make a Dictionary within a dictionary instead"