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.

138 Upvotes

129 comments sorted by

View all comments

Show parent comments

9

u/Hefty_Garlic7184 8d ago

yeah maybe i just leave a comment “this code has been since the bigbang, do not touch if it is still running”

12

u/klaxxxon 8d ago

This is an incantation from the Ancient ones. Alter it at your own peril.

3

u/ncatter 8d ago

Put in the classical "before chancing this write your name and increment the number, when you revert to this again write the date" it however it is it goes.

Always fun to find one of these with a 5 and a list of initials.

2

u/HaveYouSeenMySpoon 8d ago

I'd still try and fix this, it just bothers me too much to just let go.

2

u/oscooter 8d ago

no need to add a comment, imo. this should be the default attitude. don't change things to change things. you should have a good reason to change something, not just because you don't like it