The structural problems I keep correcting in AI-generated code, even with good prompts and solid plans.
Apr 27 2026Notes on software engineering.
- What I keep fixing in AI-generated code
- How edit forms should load dropdown data
Edit forms with multiple dropdowns usually trigger one API call per dropdown. Two problems follow — the form stays blank until all calls resolve, and load time scales with dropdown count. This note covers how to fix both: embed current selections in the entity response, aggregate option lists into one scoped endpoint. Two requests total, regardless of dropdown count.
Apr 21 2026 - Navigation properties make database calls invisible
Navigation properties make database calls look like property access. The query fires, the change tracker updates records, the cartesian product bloats the result — none of it visible at the call site. This note covers why I use foreign key IDs instead.
Dec 11 2025 - Git worktrees for parallel branch work
Using git worktrees to work on multiple branches simultaneously without managing local file changes.
Dec 10 2025 - Handling Enum Values as Strings in C# API Models
A practical pattern for working with enums in API request models - storing as strings while keeping type-safe enum logic throughout your codebase.
Oct 19 2025 - Standardize Data at Write Time, Not Read Time
Why I normalize data from multiple sources when saving to the database, not when displaying it. Using IoT temperature monitoring as a practical example.
Oct 18 2025 - Property Getters vs Get Methods: When to Use Which
A detailed guide on choosing between property getters and get methods in object-oriented programming, with practical examples and best practices for API design.
Oct 14 2025 - A Baseline CloudFormation Layout That I Keep Reusing
A structured approach to organizing AWS CloudFormation templates for containerized web applications, covering VPC networking, ECS Fargate, RDS, and automated deployment processes.
Oct 13 2025 - The Static-Instance Singleton Pattern in Flutter
Static methods for state changes, instance properties for reads. A singleton API pattern for Flutter.
Oct 12 2025 - Detecting Manual AWS Changes in CloudFormation Stacks
How to detect and manage configuration drift in AWS CloudFormation stacks.
Oct 11 2025 - What makes code hard to change
Why code becomes hard to change: cohesion failures, coupling failures, leaked decisions, and other structural causes of unmaintainable software.
Apr 24 2025 - Your system is an ETL pipeline
Understanding how most software systems inherently function as ETL pipelines and how to leverage this perspective for better system design.
Apr 23 2025 - Wrapping Google Sheets as a backend instead of migrating away from it
A practical approach to using Google Sheets as a lightweight backend solution, preserving existing business logic while avoiding unnecessary rebuilding of systems.
Apr 22 2025 - Build the throwaway prototype first
Before integrating unfamiliar code into production, explore it in a throwaway project first.
Apr 21 2025 - A loop that does five things is five problems
How to simplify complex data processing loops by refactoring them into clear, maintainable transformation pipelines using functional programming concepts.
Apr 20 2025 - Serilog Correlation IDs for background tasks in .NET Core
How to implement and manage correlation IDs in background tasks using Serilog in .NET Core applications for better logging traceability.
Mar 23 2025 - Use enums over booleans for status fields
Why and how to use enumerated types instead of boolean flags for status fields, improving code maintainability and preventing future refactoring headaches.
Oct 30 2024 - Developer Command Snippets
A consolidated collection of command snippets I use regularly — PowerShell, PostgreSQL, RabbitMQ, AWS CLI, NPM/NVM, Chocolatey, and EF Core.
Feb 29 2024 - How to Use Pseudocode to Design Better Software - Working Example
A practical demonstration of pseudocode-driven development for designing maintainable software, with a real-world example from requirements to implementation.
Aug 13 2023 - Overriding services ASP.NET Core integration tests using ConfigureTestServices
Learn how to effectively override services in ASP.NET Core integration tests using ConfigureTestServices, with practical examples and testing patterns.
Aug 11 2023 - Test-specific AppSettings configuration in ASP.NET Core integration tests
How to properly configure and manage test-specific application settings in ASP.NET Core integration tests, ensuring isolated and reliable test environments.
Aug 10 2023 - Dynamic SQL queries: string concatenation vs SqlKata
A comparison of approaches to building dynamic SQL queries in .NET applications, contrasting string concatenation with SqlKata's query builder for safer and more maintainable code.
Jan 23 2023 - Type-safe appsettings configuration in .NET Core
Implementing strongly-typed configuration in .NET Core applications with built-in validation, using options pattern and data annotations.
Jan 8 2023 - Solving the N+1 query problem
A deep dive into diagnosing and fixing the N+1 query anti-pattern in ORMs, with practical examples of using eager loading and joins to improve database performance.
Jun 10 2018 - How to Extend Select2 with Adapters
A guide to extending Select2's functionality using its adapter and decorator patterns, with practical examples for customizing appearance and behavior.
Oct 24 2017 - Refactoring a Feature Envy Code
A practical guide to identifying and fixing Feature Envy code smell in C#, with step-by-step examples of moving behavior to where the data lives.
Jul 24 2017 - ASP.NET MVC5 Feature Folders Structure
How to organize ASP.NET MVC5 projects using feature folders for better maintainability and separation of concerns, with practical examples and implementation details.
May 27 2016 - How to Refactor Business Rules Using the Specification Pattern
A practical guide to implementing the Specification pattern for cleaner and more maintainable business rule validation in your code.
Sep 29 2015 - Rhino Security and StructureMap Integration Guide (Archive, 2015)
A comprehensive guide to integrating Rhino Security with StructureMap in .NET applications for robust security management.
Jan 11 2015 - .NET Database Development with FluentMigrator (Archive, 2014)
A comprehensive guide on implementing database versioning with FluentMigrator in .NET projects, including automated migrations, version control integration, and cross-database provider support.
Dec 12 2014