Hacker News new | ask | show | jobs
by voidifremoved 1862 days 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.

1 comments

Side-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.
BTW, this is a non-issue with C# 1.0 and later due to `yield return` syntax.
Sorry, 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.

The comment you responded too were talking about debug experience.