Are (c#) dictionaries an Anti Pattern? [on hold]

Published: 28/08/2019
Are (c#) dictionaries an Anti Pattern? [on hold]
Source: SOFTWAREENGINEERING.STACKEXCHANGE.COM

I find myself often looking up questions online, and many solutions include dictionaries. However, whenever I try to implement them, I get this horrible reek in my code. For example every time I want to use a value: int x; if (dict.TryGetValue("key", out x) { DoSomethingWith(x); } That's 4 lines of code to essentially do the following: DoSomethingWith(dict["key"]) I've heard that using the o

Read more
Related news
Comment
FACEBOOK