C(ooking)#

Software development and cooking. Two worlds apart or is it? Object oriented programming models software after real world objects, and in my opinion, models cooking rather well too. Consider a recipe defined like this (ignoring visibility): class MeatMarinade { MixingBowl mixBowl; MeatMarinade() { mixBowl = new MixingBowl(); //Get a clean bowl } Marinated CreateBasic(M meat,…

C# The little things that bite (I)

Even as an experienced developer, my code can sometimes bite me (hard). Being “experienced” doesn’t spare you from newbie mistakes. You’ll just be laughing at yourself for doing it soon after. “The struct that bites” Consider this… var dict = new Dictionary<int, StructA>(); dict.Add(1, new StructA()); dict[1].SomeProp = SomeNewValue; The bite comes when I expect…