9 ms·
The original is almost impossible to debug when something inevitably goes wrong too. I have encountered dozens of places where streaming API calls have been re
by voidifremoved 5y ago
The original is almost impossible to debug when something inevitably goes wrong too.
I have encountered dozens of places where streaming API calls have been reworked into imperative by whoever ends up maintaining it just so they can figure out why the hell it is breaking in some unforseen edge case.
- willtim 5y agoSide-effects do not mix with lazy on-demand streams! This is unfortunately a problem with bringing functional programming constructs to a language with idiomatic pervasive mutation.
- lostmsu 5y agoBTW, this is a non-issue with C# 1.0 and later due to `yield return` syntax.
- twhitmore 5y agoSorry, I'm skeptical -- how exactly does a 'yield return' resolve the divergences between functional programming & mutable data structures? My layman's impression was that 'yield return' was largely syntactic sugar around an iterator, rather similar to Java.
- lostmsu 5y agoThe comment you responded too were talking about debug experience.