Is there a best practice for the number of nested "foreach"?
That is I'm spiraling into nested "foreach" over Complex dictionaries, is there a point where it starts to produce overhead that "COULD" impede performance? Is this something even worth considering.
To make it specific and not open to being subjective: I have 3 Complex Dictionaries that look like this;
Dictionary<int, Dictionary<string, XObject>()
Dictionary<string, List<YObject>()
Dictionary<string, Dictionary<string, List<ZObjects>()
Obviously now, as I filter these Dictionary (in a foreach), to produce the data I'm looking for, the structure of my code is heading towards 5 Nested "foreach" excluding the Outer 1. In answering these are the areas I'm worried might be impacted:
Best practice or doesn't matter?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With