Two C# idioms: On defaults and switch

from blog Just Some Code, | ↗ original
In this part of the C# idioms series, we have one idiom to write more intention-revealing defaults and another idiom to convert mapping code using a switch to a more compact alternative using a dictionary. Use intention-revealing defaults When initializing variables to default values, use intention-revealing alternatives. Are you initializing a...