IAsyncEnumerable
for and by dummies
Published by marco on
This isn’t a terrible video on IAsyncEnumerable
but it’s also not nearly as high-level and fast-paced as I’m come to expect from the .NET Deep Dive series, which is no-muss/no-fuss with Stephen Toub. Those are much better than this one but, if you’re not grokking what IAsyncEnumerable
is good for from the documentation or examples, maybe this one-hour video will help. If you’re lucky, it will make you feel better about your own skills as a programmer.
Maybe I’m just super-smart but I can’t understand why so many of Microsoft’s .NET videos spend time discussing the _
separators in numbers. Hanselmann always points it out whenever Toub uses them in a longer constant like e.g., 10_000_000
.
Whereas it seems blindingly f”&king obvious what they’re for, Cam Soper in this video just had to ask about them, presumably because, even though he almost certainly knows what they are, he thinks that the audience for a video about IAsyncEnumerables
would also be unable to intuit what those symbols might be.
So, they get three people involved in a discussion about thousands separators. It’s a waste of time. OMG, I started writing this rant at what I thought was the end of the “basic C# syntax” discussion but I was wrong. They continued for thirty more seconds, with a fourth person chiming in. “C# 7; I just verified.” Congrats, guys! We solved it!
The next thing we got to do was watch the async guru use Task Manager to do memory profiling. Have these guys never heard of Benchmark.Net? Or are they just trying to make other developers feel better about themselves?
I am fascinated that they don’t explain the mechanism behind the IAsyncEnumerable
at all. Chase just talks about it as it were magic rather than an enumerable that returns a sequence of Tasks
. The magic is in the enumerable part, which allows an algorithm to avoid creating all of the data in memory at once.
The example at 57:00 with System.IO.Pipes, System.Text.Json
, and IAsyncEnumerable
was quite nice, though. It shows the power of the piping abstraction (which lies below streams). It’s a pity they didn’t get into that more but maybe a follow-up video by Stephen Toub is in the offing.