C# 9 Records were reference types (classes). C# 10 brings Record Structs. This gives you: 1. Value semantics (stack allocation). 2. Immutability. 3. `ToString()` printing content. 4. Zero allocation! Use this for high-frequency types like GEO coordinates, financial ticks, or composite keys.
Read more โMonth: August 2021
Docker Init Process: The Zombie Reaper
Running a process as PID 1 in a container has side effects. The most common is the “Zombie Process” problem. The Problem In Linux, only PID 1 can reap orphaned child processes. If your app (e.g., Node.js or Java) runs as PID 1 but doesn’t handle `SIGCHLD` signals, zombies accumulate, exhausting the process table. The […]
Read more โSvelte vs React: A 2021 Perspective
React involves shipping a runtime (Virtual DOM) to the browser. Svelte is a compiler that generates vanilla JS. The difference is profound. Reactivity Models React (Pull) React re-renders the component tree when state changes. You must use `useMemo` and `useCallback` to prevent unnecessary work. Svelte (Push) Svelte uses topological ordering during compilation. Assignments *are* the […]
Read more โAzure Service Bus: Messaging Patterns
Azure Service Bus is the enterprise messaging backbone. Beyond simple queues, it offers powerful patterns. Topic Filters (Pub/Sub) Instead of creating a queue for every variation, create one Topic. Subscribers can filter what they receive using SQL filters. Dead Letter Handling Always handle your Dead Letter Queue (DLQ). Messages go there after max delivery attempts. […]
Read more โManaging Terraform State in Azure
Terraform state is the “brain” of your infrastructure. If you lose it, you are in trouble. Storing it locally is a no-go for teams. Azure Storage Backend We use Azure Blob Storage to hold the state file. It supports state locking (via Leases) to prevent two developers from applying changes simultaneously. Bootstrap Script The chicken-and-egg […]
Read more โTesting .NET 6 Applications: Integration Testing with WebApplicationFactory
Integration testing is the highest value testing you can do. In .NET 6, `WebApplicationFactory` makes it incredibly easy to spin up an in-memory version of your API for testing. Exposing the Program Class With Top-level statements, `Program` is internal. To test it, you need to expose it in `Program.cs`: The Test Setup
Read more โ