mailwal

CD#632 What's in a task?

C# Digest

Try a mature, GPU-accelerated UI framework that works with your existing C# stack
sponsored by Qt Group

Current C# UI options take significant effort on cross-platform consistency, performance, and backend integration. Qt Bridge for C#, now in Technology Preview, adds Qt’s mature, GPU-accelerated UI framework cleanly on top of your existing C# backend, with native UX on Windows, macOS and Linux. Read the blog for more insights and give us your feedback.

What's in a task?
2 minutes by Ricardo Peres

Tasks in .NET run operations in the background without blocking the main thread. You can either wait for a task to finish using await, or let it run in the background without waiting. If you skip await, you must manually check if the task completed, was cancelled, or threw an error. Ignoring these checks can cause blocked threads or missed exceptions.

Where are your Azure AI tokens going?
sponsored by Stacklet

Your AI bill shows the total, not who spent it. Stacklet Token Custodian attributes every token to a team, project, or app across Azure AI, OpenAI, Anthropic, and more. Then it enforces budget and usage policy. Set that policy in the UI or as code in Git. See where your tokens go.

Prompts are dead; long live loops.
7 minutes by Jesse Liberty

Loop programming lets an AI agent act, check its own results, and try again until the output meets a set standard or hits a safety limit. The Microsoft Agent Framework supports this with loop wrappers and evaluators, which control when the agent stops or keeps going. A marker evaluator looks for a keyword like "DONE," while a judge evaluator asks a second model to rate the output. Always set a maximum iteration count and a timeout to prevent runaway costs.

How fast can you fix a UTF-16 string?
3 minutes by Daniel Lemire

C# strings can contain broken character pairs that should never be written to disk or sent over a network. New functions in the SimdUnicode library detect and fix these broken strings using the same approach already shipped in Chrome. The functions process data in parallel using special processor instructions, reaching speeds around 69 GB/s on Intel hardware. When the input is already valid, fixing it is roughly as fast as a plain memory copy.

Primary constructors are more than syntactic sugar
3 minutes by Steven Giesel

Primary constructors and regular constructors look the same but initialize fields at different times. With a regular constructor, fields are assigned after the base constructor runs. With a primary constructor, the compiler stores parameters in hidden fields before calling the base constructor. This matters when a base constructor calls virtual members, since those members may read fields that aren't set yet in the regular case but are already ready with a primary constructor.

How to loop through a list – benchmarked
12 minutes by Khalid Abuhakmeh

Use foreach by default to loop through a list in C#. Switch to a for loop when you need the index or want to replace items. Avoid modifying a list inside foreach as it throws an InvalidOperationException. For raw speed, CollectionsMarshal.AsSpan is about 20% faster than for or foreach, while List.ForEach and Index are slower and allocate extra memory.

And the most popular article from the last issue was:

newsletters


Would you like to advertise in the newsletter? Check out our media kit and get in touch.


© 2026 Bonobo Press

Jakub Chodounsky (dba. Bonobo Press)
1/25 Mana Street
Wellington, New Zealand
Privacy Policy