Practical .NET
Errors, data, files, and async code for real programs.
- Exceptions
An exception stops the current line. catch decides what happens next.
Errors · 8 min - Validation
TryParse checks input without throwing.
Errors · 8 min - Dates and culture
Parse dates with an exact format and the invariant culture.
Data · 8 min - Money
Round money once, at the end, with an explicit rule.
Data · 8 min - JSON
System.Text.Json turns records into text and back.
Data · 8 min - Text formats
Alignment and format strings line up a table.
Output · 8 min - Project files
A run can write files. You decide whether to keep them.
Files · 8 min - async and await
await waits for a task without blocking the program.
Async · 8 min - Timers and cancellation
A CancellationToken asks running work to stop.
Async · 8 min - Separate calculation from output
Compute in one place, print in another.
Design · 8 min - Parsing with an explicit numeric grammar
Choose the permitted numeric syntax instead of inheriting ambient culture rules.
Practical workflows · 15 min - Comparing instants with different offsets
Separate a point on the timeline from its displayed local clock time.
Practical workflows · 15 min - Date-only and time-only domain values
Represent calendar dates and clock times without inventing an unnecessary timestamp.
Practical workflows · 15 min - Rounding at a documented money boundary
Choose whether rounding happens per line or after aggregation.
Practical workflows · 15 min - A JSON contract with explicit property names
Keep the wire format separate from an internal object model.
Practical workflows · 15 min - Strict and permissive JSON document options
Accept format extensions only when the import contract permits them.
Practical workflows · 15 min - Small regular expressions with a precise contract
Validate a narrow identifier format without treating every text problem as a regex.
Practical workflows · 15 min - Building a deterministic text report
Separate calculation, ordering, and repeated text assembly.
Practical workflows · 15 min - UTF-8 bytes and text boundaries
Measure encoded data separately from the number of UTF-16 code units.
Practical workflows · 15 min - Hexadecimal as a byte representation
Round-trip binary values without confusing bytes with formatted text.
Practical workflows · 15 min - Escaping a URI query value
Encode data as one component instead of concatenating it as URI syntax.
Practical workflows · 15 min - Boundary examples as executable checks
Test the points where a small rule changes its answer.
Practical workflows · 15 min - A result value for expected rejection
Return success or a reason without throwing for ordinary invalid input.
Practical workflows · 15 min - Ownership at a using boundary
Dispose the resource you own when its work scope ends.
Practical workflows · 15 min - Isolating failures within a batch
Decide which errors reject one record and which errors should stop all work.
Practical workflows · 15 min - A small import pipeline with explicit stages
Parse a limited row format, validate values, aggregate duplicates, and report results.
Practical workflows · 15 min