3 ms·
Agreed, simpler is better. To be even simpler, In this example, these two lines can be just one: Action<List<string>> DoDarkMagic = (creatures) => { creatu
by SideburnsOfDoom 5y ago
Agreed, simpler is better. To be even simpler, In this example, these two lines can be just one:
Action<List<string>> DoDarkMagic = (creatures) => { creatures.RemoveAt(0); }
DoDarkMagic(dwarfs)
There is no point in putting the action in a variable, only to invoke it on the next line. This is a meandering way of expressing:
// Do Dark Magic
dwarfs.RemoveAt(0);
Extract a private method if you're keen on keeping the name.
- keithnz 5y agoit was just an example on the authors page, he explains that in reality you'd actually have some real thing you'd be testing
- SideburnsOfDoom 5y agoyes, it's an example of how these frameworks encourage accidental complexity.