await!

Bisher habe ich um das async/await Pattern in C# eher einen Bogen gemacht. Grundsätzlich war mir mehr oder weniger klar, was da vor sich geht, aber wozu syntaktischer Zucker, wenn es auch so geht? Es sieht schöner aus. Zumindest für diejenigen, die "Schönheit" für uns festlegen. Aber inzwischen trifft man auf Konstellationen, in denen man gar nicht mehr drumherum kommt, z.B. wenn eine Bibliothek, die man verwenden möchte nur noch LalaBlaBlubAsync(...) Aufrufe hat, wobei die Vorversion noch mit LalaBlaBlub(...) auskam. Tja.

Ich wollte dann doch mal etwas tiefer gehen und stieß auf diesen interessanten Artikel (Achtung MSDN Link). Ich finde, das Konzept wird hier wirklich schön erklärt. Das Beste daran ist jedoch dieses herrliche Zitat:

“Asynchronous code reminds me of the story of a fellow who mentioned that the world was suspended in space and was immediately challenged by an elderly lady claiming that the world rested on the back of a giant turtle. When the man enquired what the turtle was standing on, the lady replied, “You’re very clever, young man, but it’s turtles all the way down!”

Better late than never!

Leave a Reply