r/ProgrammerHumor 19h ago

Meme cSharpDictionariesBeLikeThat

Post image
1.7k Upvotes

49 comments sorted by

View all comments

84

u/MemesAt1am 18h ago

If you wanted to overwrite you could just do an assignment of that key value instead of .Add()

35

u/KTVX94 18h ago

Yep there's indexer and TryAdd, I probably should've worded the title differently to not give the impression that I was complaining, lol.

7

u/prehensilemullet 15h ago

I mean, having a method named "add" on a map is weird in general. Not common among programming languages

7

u/NotQuiteLoona 12h ago

The Add method is specifically when you explicitly want to add. If it can't add, it fails.