We’ve all had bloated CQRS handlers. You open up a command, query, or event handler, and it’s a bloated mess. It’s a nightmare of code. There’s validation, authorization, state changes, side effects, logging, it’s a mess to maintain and it’s really hard to test.
Check out my YouTube channel, where I post all kinds of content on Software Architecture & Design, including this video showing everything in this post.
Now, mind you, this is a very simple example, but you’ll get the gist because there are a lot of concerns here. This example is dispatching a shipment, basically, a package.
Here’s what that might look like:
Mind you, in the real world, you could probably imagine this being hundreds of lines long with all kinds of validation, state transitions, and other logic, but you get the gist. There’s a lot going on here. This can often be pretty typical of most CQRS handlers that contain validation, state changes, and other concerns such as email and event publishing in this example.
I still have my shipment logic here, but instead of doing that validation to make sure the status was in a ready state and then changing the state, I moved that all into our shipment.
I created a Dispatch method where I just moved that logic into it.
Now, hold up a minute here, because you might have watched some of my other blogs/videos where I harp on indirection.
I’m not suggesting you do everywhere. Do this when, you have another place that uses the exact same state transition. Put that logic in a central place so that you always know you’re in a valid state.
Don’t add indirection for no good reason.
Having made that disclaimer, let’s go to step two, creating a pipeline so you can execute small, simple tasks that are part of your flow.
This is often referred to as the Russian Doll pattern.
If you’re familiar with ASP.NET Core Middleware, it’s the exact same idea, except this is scoped down to a single application request, like a specific use case.
That’s exactly what I’ve done in code, broken it apart to create a pipeline.
I’m not going to show all the trivial code for executing or defining a pipeline, you’re likely already using tooling if you’re working with commands, queries, or event handlers. The tooling you’re using might already support this, so check the documentation.
The important part is that I have a context.
This context is passed through my pipeline from one step to another.
Now, I used to have logic for sending the email directly in here, but we can actually do that as part of the event instead.
That’s not even part of the pipeline, just completely asynchronous.
If we’re using some event-driven architecture, whether in-process or not, I can handle that event separately when the shipment is dispatched to notify the customer.
So now we’ve broken apart that original handler that had a lot of concerns into small steps, each calling the next.
And remember, because this is a Russian doll, when we call that last next, there’s nothing left to call, it returns. Then, the previous step resumes, which in our case saves the shipment to the database.
Now, everything has trade-offs.
One of the first benefits you’ll notice here is that it’s way easier to test because you’re testing a single step. You don’t have one big handler with seven dependencies. Instead, you have a small step that might have one or two dependencies that you can fake or mock easily.
That makes testing each part a lot simpler.
Another benefit is that it’s composable.
You might have certain steps that you want in every pipeline.
You might’ve noticed in the example that maybe you’d want to use the outbox pattern so that events aren’t published until after the database transaction commits. That’s a perfect fit here.
Now, the downside is indirection, and that’s my biggest complaint about a lot of software.
If you look at a call stack, it can be a layered, nested mess. This pattern does add that.
But, like everything, there are trade-offs.
If you have complicated workflows and a handler with a ton of dependencies and hundreds or thousands of lines of code, there’s a benefit to breaking it apart like this.
It’s always about trade-offs.
Join CodeOpinon!
Developer-level members of my Patreon or YouTube channel get access to a private Discord server to chat with other developers about Software Architecture and Design and access to source code for any working demo application I post on my blog or YouTube. Check out my Patreon or YouTube Membership for more info.
The post Clean Up Bloated CQRS Handlers appeared first on CodeOpinion.
Get ready to level up your C++ productivity, because Visual Studio 2026 version 18.0 is now generally available! You can take advantage of the new features, bug fixes, and performance improvements in your production environment. This post describes what’s new for C++ developers, including new features or improvements in these areas:
You can also read the broader announcement on the Visual Studio Blog for more details on changes that are non-C++-specific. Let’s dive in!
You can always give us feedback about your Visual Studio experience on Visual Studio Developer Community or from the Help > Send Feedback menu in the IDE.

Over the past 12 months, we fixed 387 C++ related issues and implemented 29 C++ related feature requests in Visual Studio. Many of the new features described in this blog post were suggested by you!
User Feedback: Update UI of Visual Studio 2022 like the new Windows 11 UI – Developer Community
The new IDE includes a UI refresh, from icon and spacing changes to 11 new themes.

User Feedback: Unified Settings feedback – Developer Community
The Visual Studio settings (Tools > Options) UI is now integrated into the editor. You can also configure the settings from a JSON file accessible from the new UI.

Your settings will carry forward from older Visual Studio versions with roaming support. However, settings will no longer sync back to older products to ensure a cleaner migration path and forward compatibility.

Visual Studio 2026 works out of the box with your existing Visual Studio 2022 extensions.
Check out our blog post, Upgrading C++ Projects to Visual Studio 2026, for an overview of what’s available to you to help you manage your transition to Visual Studio 2026, including continued binary compatibility for the C++ build tools and redistributable and the new Visual Studio setup assistant. Then, take a look at our updated porting and upgrading guide in our documentation.
Version 18.0 of the IDE ships with Microsoft C++ (MSVC) Build Tools version 14.50, offering our best conformance, build performance, and runtime performance story yet, along with a multitude of bug fixes. To get access to all the new language features, be sure to build with /std:c++latest or go with /std:c++23preview if you only need features up to and including C++23.
C++23 language updates in the compiler are summarized in the C++ Language Updates in MSVC Build Tools v14.50 blog post. They include, but are not limited to:
auto(x): decay-copy in the language, for casting x into a prvalue as if passing it as a function argument by value.#warning to allow code authors to generate a diagnostic message without stopping translation the way #error does.Microsoft C++ standard library (STL) changes are summarized at: Changelog · microsoft/STL Wiki. As this is an open-source project, we welcome community contributions. With the help of the community, we implemented many improvements, including, but not limited to:
monostate in <utility>.std::istream::ignore(n, delim) less surprising. This had surprising behavior if delim is a char with a negative value. This change removes the surprise to make code more robust.syntax_option_type.regex_traits::transform_primary mistakenly detects typeid of a function.ranges::distance does not work with volatile iterators.[[msvc::no_unique_address]] as a space optimization in several C++23 components.__is_trivially_equality_comparable to improve the performance of equal(), ranges::equal, and many vectorized algorithms for more types.minstd_rand and minstd_rand0's discard() member functionstd::includes() to have the same performance as ranges::includescount() for vector<bool>Working closely with our game developer partners, we invested in runtime performance improvements for code built with MSVC. We measured these improvements using benchmarks from Unreal Engine City Sample (RenderThread and GameThread):


In Visual Studio 2019 we added AddressSanitizer support for code built with MSVC to help developers identify memory safety issues with zero false positives using the /fsanitize=address flag. At the time, the support applied to code built for x86 and x64 architectures. This support is now extended to projects targeting ARM64. This ARM64 support is in preview, and we will continue to refine it and fix any incoming bugs in future updates.
We worked on several developer productivity improvements in 18.0, many in response to feedback from you!
User Feedback: Adding a shortcut Ctrl+W to close the file in VS – Developer Community
Several keyboard shortcuts have been added from VS Code and other editors to give you a more consistent experience as you switch between these environments. In the past, this included Ctrl + / to toggle line comments and Ctrl + Shift + P to open Feature Search. But the following shortcuts are new in 18.0:
Ctrl + W now closes the current tab (in addition to Ctrl + F4)Ctrl + P now opens Code Search (in addition to Ctrl + T and Ctrl + ,)User Feedback: Syntax highlighting: use a unique color for C++ attributes – Developer Community
C++ attributes are now colored in the editor, making your code more visually distinctive and easier to read. By default, they use the same theme color as user-defined types.

User Feedback: Search in Class View does not work, if search term is not the beginning of the class but part of it – Developer Community
The Class View window now supports substring searches, so you can have an easier time examining the architecture of your code.

In addition, Class View’s performance has been improved for Unreal Engine projects.
User Feedback: Make it possible to see preprocessed C++ source code (easily in IDE) – Developer Community
You can right-click a C++ file in Solution Explorer and select Preprocess to instantly generate its preprocessed output, making it easy to debug macros and includes, see errors immediately, and avoid manual changes to project settings or interruptions to full project builds.

User Feedback: I wish Visual Studio 2022 able to show file encoding in the editor. – Developer Community
The bottom margin in the editor has been upgraded to be more informative and customizable. Line, column, and character position are now unified into a single display. Clicking it opens the Go To Line dialog for faster navigation. When working with multiple selections, you’ll see total counts for selections, characters, and lines. Hovering over the selection margin reveals detailed info per selection.

File encoding is now displayed in the margin for quick reference. You can also save or reopen a file using a specific encoding, which helps ensure proper display of special characters, supports multiple languages, and maintains consistent readability across systems.
Clicking the encoding margin opens a context menu where you can choose to save or reopen the file. Selecting an option will launch an encoding dialog with a dropdown list of available encodings to choose from.

A new context menu has been added to the margin, giving you full control over what information is shown. This menu includes all the bottom margins in the editor, from the zoom control all the way to the new encoding margin.

You can manage these settings through Tools > Options > Text Editor > General > Display > Show editing context in the editor. For quicker adjustments, right-click the bottom margin to open the new context menu and change what’s shown.
User Feedback: Find and Replace — option to exclude folders – Developer Community
You can now exclude files you never need to look at from Find in Files (Ctrl + Shift + F) and Quick Find (Ctrl + F). To set it up, go to Tools > Options > Environment > Search, and look for the new Exclude files from search results section. There, you can add, edit, or remove glob patterns to control exactly which files are left out of your search results.

GitHub Copilot Chat allows you to use natural language to get answers to questions (Ask mode) or even implement changes for you automatically (Agent Mode). We made several improvements to this feature (listed below), and we also have 3 new features available in Private Preview: New GitHub Copilot capabilities for C++ developers: Upgrade MSVC, improve build performance, and refactor C++ code.
User Feedback: Visual Studio GitHub Copilot line number difference – Developer Community
Copilot Chat is getting smarter with improved context for your everyday tasks. You can expect better results when searching your codebase and referencing specific lines in your code.
User Feedback: Quickly Get Copilot Assistance from Your Context Menu – Developer Community
A Copilot Actions option was added to the right-click context menu in the Visual Studio editor.

You can use this to interact with a specific file or lines of code in Copilot Chat. You can ask Copilot to explain what the code does, make optimizations, generate comments or unit tests, or just reference it in the chat for you to add your own custom prompt.
You can now ask Copilot to summarize uncommitted code changes, explain a specific commit, and more.

You can reference uncommitted changes by adding #changes to your prompt or type #commit: to pull up a list of the most recent commits for you to select. You can also reference a specific commit id.

With the context of your changes or commits, you can then ask Copilot to answer questions in Ask Mode or perform tasks in Agent Mode like writing unit tests or finding bugs.
You can paste a URL in the prompt box and Copilot will pull information from the web to prepare its response. For example, you can ask Copilot to write a readme file based on best practices from GitHub or to look at reference material while preparing an answer to a question.

This only works for public URLs and static HTML content.
Visual Studio 2026 continues to maintain native support for MSBuild, CMake, and Unreal Engine projects.
Many MSBuild projects generated using new project templates now target C++20 by default. This includes the Console App, Windows Desktop Application, Dynamic-Link Library, and Static Library.
Visual Studio 2026 now includes CMake 4.1.1 by default. CMake also includes a Visual Studio 2026 generator and modern SLNX projects, allowing you to build Visual Studio C++ projects directly from CMake.
CMake projects now have native support for profiling tools including CPU Usage, Events Viewer, memory usage, and File IO tools in Visual Studio. The CPU Usage tool also includes Copilot-powered performance insights, helping you detect and resolve bottlenecks even faster.

Tailored for game developers and performance-critical workflows, this update lets you:
User Feedback:
The clang-tidy code analysis tools in Visual Studio have new configuration options. You can allocate more processors to run code analysis as part of your build, speeding up your development workflow. Plus, you can add custom arguments to the command line to invoke clang-tidy, giving you complete control over your analysis setup.

You can access these powerful new options from Project Properties > Code Analysis > Clang-Tidy.
The ability to set command line arguments for the debugger from the toolbar has been expanded to include all .vcxproj, CMake, and Unreal Engine projects. The feature has also received the following improvements:


This feature is no longer tied to the Game Development with C++ workload and is available to all C++ developers without needing to install any additional workloads or components.
To learn more, take a look at the Pass command-line arguments documentation.
User Feedback: Mermaid support and code highlighting in markdown previews – Developer Community
You can now render Mermaid charts in the markdown editor preview window, where you can provide your own Mermaid syntax or generate it with Copilot. This lets you visualize complex data structures and workflows in the IDE.

Visual Studio Container Tools now support Podman, a popular container management tool that provides a daemonless container engine. This allows you to run and manage containers using the Podman CLI directly from Visual Studio.

To get started, simply start Podman and open your solution in Visual Studio.
The Visual Studio Git tools also received some updates:
Ready to get started? Try out Visual Studio 2026 version 18.0 today and feel free to share your feedback below! Also check out the release notes for a full list of what’s changed!
The post What’s New for C++ Developers in Visual Studio 2026 version 18.0 appeared first on C++ Team Blog.
To sign up for Windows 10 ESU, open Settings > Updates & Security > Windows Update, and click on “Enroll now.” Once you are on the Enrollment page, select Microsoft account as an option (it should be already selected if sync is turned on) or choose one of the other two options – Rewards or $29.99 paid ESU.

Windows 10 has already reached its end of support on October 14, 2025. The retired OS is getting its first Patch Tuesday update on November 11. However, the update is available only to those who have registered for Windows 10’s Extended Security Updates (ESU) program.
If you haven’t enrolled already, there are three ways by which you can receive security updates on your Windows 10 PC for an additional year, until October 2026.
Windows 10 had a glorious 10-year run, but as it came to an end, there was widespread backlash from users who didn’t want to be pressured to upgrade to Windows 11. The newer OS also had a bad reputation for not being as stable as its predecessor. Windows 11’s strict minimum requirements were also a hindrance.
Either way, Microsoft responded with the Windows 10 Extended Security Updates (ESU) program, which is a free service, when availed, allowed users to receive critical and important security updates for their Windows 10 PCs, even after the official end-of-support.
Microsoft, of course, wants everyone to use Windows 11, but they also don’t want existing users to switch to other platforms, so ESU was the way to go. Windows 7 also provided extended support like this for three extra years.
But unlike Windows 7 ESU, which was limited to only enterprises, Windows 10 ESUs are available for home users as well. Microsoft calls it Windows 10 Consumer Extended Security Updates. For context, home user is anyone using a PC with a regular Microsoft account or a local account, not a work account.
However, ESUs for commercial users are available for 3 years at $69 USD per device for the first year, with prices doubling every consecutive year, until the end of the third year, which is when support stops altogether.
For home users, Windows 10 ESU is available for only one year, and fortunately, it is free. Well, almost free.
Windows 10 Consumer ESU program is available for mainstream editions of the OS, including Home, Professional, Pro Education, or Workstation editions.
You’ll need to be on the latest Windows 10 version 22H2, and your device must have an administrator account.
Needless to say, your device shouldn’t have a work account associated with it; otherwise, you might see errors while enrolling for Windows 10 Consumer ESU.

Also, if you happen to be in any European region, you might see a prompt saying that Windows 10 ESU is not available.

Things work as they should for US users, though.
For regular Windows 10 users, Microsoft offers the Consumer ESU program for free, but with a caveat. The ESU licence itself doesn’t cost anything, but Microsoft demands that you use your PC with a Microsoft account.
Once you do that, ESU activates automatically at no extra cost, and the enrollment lasts one year, ending in October 2026, after which your Windows 10 PC receives no more updates.
The good thing is that you can enroll up to 10 PCs per Microsoft account, which is plenty for a household.
But if you don’t want to sell your soul to Microsoft, and you insist on using a local account on your Windows 10 PC, it will cost you $30 USD. You can, of course, choose not to enroll in Windows 10 ESU and continue using the OS for free, but you wouldn’t get any security updates, and your PC will remain vulnerable.
We recommend that you enroll in Windows 10 ESU, and to do that, Microsoft gives you three generous options.
Ironically, enrolling in Windows 10 ESU for free is easier than the paid version, and it makes us believe that Microsoft values your data more than $30 USD.
To register for Windows 10 ESU for free, go to Settings > Update & Security > Windows Update. You will see the Update page prompting you to Enroll in Extended Security Updates. If you don’t see it, click the Check for updates button. 
Click the Enroll now button, and you’ll see a pop-up where Microsoft tells you why you should enroll in Windows 10 ESU. Click Next. 
To proceed further, you need to sign in to your Microsoft account. If you have been using a local account and don’t even have a Microsoft account, now is the time to create one. Note that you cannot proceed further unless you sign in, even if you are willing to pay the $30 USD to register Windows 10 ESU and run your PC with a local account. 
If you are using a Microsoft account that has already backed up Windows settings in another PC, then Microsoft graciously shows that “You’re eligible to enroll in Extended Security Updates at no extra cost.”.
For context, the PC I’m using here has never seen my Microsoft account before, and I have been using it with a local account. But now, I have signed in with a Microsoft account that has already backed up Windows settings on another PC. 
If you click Enroll, it will take a few seconds, and the registration process will be complete, with validity till October 13, 2026. 
If you sign in with a new Microsoft account, or one that hasn’t already backed up your PC settings, Microsoft will give you three options:
Microsoft desperately wants you to use OneDrive to back up your Windows 10 PC, after which you can register for Windows 10 ESU for free. Funnily enough, OneDrive plans are just a fraction of the $30 USD needed to register for ESU to use with a local account.
It’s clear that Microsoft does this to create a direct path for when you want to upgrade to Windows 11, if you choose to do so. When you click to enroll in Windows 10 ESU, the top option is to back up your PC settings. 
Microsoft says that you can “Save your settings, apps, and credentials, so you can move to your new Windows 11 PC”
You can select it and click Next, and in a few seconds, Microsoft will show you that you have enrolled in the Extended Security Updates.
However, in my test machine, I noticed that Windows 10 didn’t show the option to manually select the backup option or the other two options to get ESU. Instead, when I created a new Microsoft account and signed in to it, it automatically showed me that I was eligible to enroll in Extended Security Updates at no extra cost.
There is no reason not to suspect Microsoft here, as I have double checked it and in both cases, I used a new Microsoft account and a relatively new Microsoft account, both of which didn’t already back up Windows PC settings, and both of which didn’t associate with any devices.
If this is a temporary issue, you might see the two other options.
You can redeem 1000 Rewards points from your Microsoft account to register for Windows 10 ESU if you do not want to back up your Windows PC settings.
Of course, if your Microsoft account is new, it will take weeks or maybe months for you to collect 1000 Microsoft Reward points.
Click the Enroll now button and select the Redeem Microsoft Rewards points option. You’ll see a window that shows that you can get critical security updates on your Windows 10 PC till October 26, 2026. Click Redeem, and you’ll be enrolled in ESU in a few seconds. 
Go to rewards.bing.com to check how many reward points you have in your Microsoft account. If you have been using Bing for a while, chances are that you’ll have well over 1000. And you can use it to register for ESU, that is, if the option shows for you.

If you want to use your Windows 10 PC with a local account, you still have to sign in to purchase the Windows 10 ESU licence.
After you sign in, select the “One time purchase” option to get extended security updates, which will allow you to use your Windows 10 PC with a local account.
Microsoft charges $29.99 for you to get one year of security updates, which may seem steep, but Microsoft doesn’t want you to spend money. They prefer you back up your PC with a Microsoft account. 
However, this is the only way to continue with a local account. Click Next and you’ll see the price updated with the tax for your country. You can choose the payment option of your choice and click Buy.
After purchase, you’ll get a confirmation from Microsoft saying that you’re enrolled in ESU through October 13, 2026. Microsoft also suggests that you back up your PC completely in your Microsoft account. But you wouldn’t want to do that, since you paid to have a local account.

The ESU is tied to the Microsoft account you signed in with, and it can be used on 10 different devices. Now, to get back your Local Account, go to Settings > Accounts, and click “Stop signing in to all Microsoft apps automatically”.

As soon as you click, you’ll see your Microsoft account getting replaced by the Local Account. So, if you want to get ESU on other Windows 10 PCs (9 more devices), you can sign into them with the same Microsoft account, enroll in Windows 10 ESU, and then click “Stop signing in to all Microsoft apps automatically”.

Yes, it is annoying that we still need to sign in with a Microsoft account and pay $30 USD in order to register for Windows 10 ESU and use a PC with a local account. This is Microsoft’s way of making it as difficult as possible to make you use a Microsoft account on your Windows PC.
Remember that you’ll get updates till October 2026; post that, you may not get updates, so we recommend that you take slow and deliberate efforts to purchase a new Windows 11 device, or to get used to the newer OS.
The post How to sign up for Windows 10 ESU, now rolling out appeared first on Windows Latest