Comment on Real quick question about the "break"
xmunk@sh.itjust.works 11 months agoIt might just be an insufficient amount of whitespace, but your second example seems much harder to parse. As someone who regularly writes extremely dense functional paradigm code - you can always use more newlines.
m_r_butts@kbin.social 11 months ago
Fine:
olsonexi@lemmy.wtf 11 months ago
idk, maybe C# just doesn’t have great syntax for the way you’re doing it or something, but I think the simplest solution is the most readable in this case:
m_r_butts@kbin.social 11 months ago
I came up with a contrived example for the sake of illustration, and deliberately chose to use LINQ to build the enumerable because of how valuable it can be in filtering and ordering data. Where and TakeWhile alone can replace a whole lot of continues and breaks.
Your code does the same job as my first example, and it's simpler, and maybe that's more appropriate for the class.