WriteAsync .NET

Testing, coding, in that order.

How fast from `wstring` to `string`?

Anyone who has dealt with both “narrow” and “wide” strings in the same C++ module is inevitably faced with this little annoyance: In MSVC, you might see an error like C2676 (“binary ‘<<‘: ‘std::basic_ostream<char,std::char_traits<char>>’ does not define this operator or…

By Brian Rogers | 28 May, 2024 | native, performance | No Comments |
Read more

Testing static_assert (MSBuild)

Now that we’ve gotten a handle on testing static_assert for CMake, let’s turn our focus to MSBuild. We will use a nearly identical project structure as what was established in the CMake stassert sample project but with all the of…

By Brian Rogers | 6 May, 2024 | build, native | No Comments |
Read more

Testing static_assert (CMake)

One of the many innovations in C++11 was static_assert. This allowed, at long last, a custom error message at compile time. Sure, we’ve had the #error directive for a while, but that only works for conditions that one could evaluate…

By Brian Rogers | 29 April, 2024 | build, native, tdd, testing | 1 Comment |
Read more

DI tricks in C++: ref or ptr?

Dependency injection, AKA “DI”, AKA “passing arguments”, is commonly used in modern software design. You’ll see this approach quite often in C# and Java applications, mainly because these languages have specific support for interfaces and interfaces are a big part…

By Brian Rogers | 8 April, 2024 | design, native | No Comments |
Read more

Digits: faster in practice?

While everyone loves theoretical performance improvements, we need to check back in with reality from time to time. To review, we had proposed a near-zero allocation strategy to help improve the speed of a Digits game solver. After all, heap…

By Brian Rogers | 4 October, 2023 | games, performance | No Comments |
Read more

Digits: faster in theory

Previously, we gave a send-off to the New York Times “Digits” game with a custom solver app. Unfortunately, the solver took quite some time (several hundred milliseconds) and even more space (several hundred megabytes) to analyze the solutions for one…

By Brian Rogers | 21 August, 2023 | design, games, performance | 1 Comment |
Read more

Goodbye Digits

As of August 8, the New York Times game Digits is no more. Digits was a game where you were given a target number and six smaller numbers. Combining the smaller numbers with the four basic arithmetic operators, you would…

By Brian Rogers | 11 August, 2023 | games, performance | 1 Comment |
Read more

Stay COM: finishing up the tests

In the last post, we began focusing on testability with COM interface stubs. It was a lot of work, and a good reminder of why backfilling test coverage via a test-last approach is not ideal. Still, it shows that through…

By Brian Rogers | 31 July, 2023 | design, native, testing | No Comments |
Read more

Stay COM: stubs and testing

Previously, we built a Windows Task Scheduler sample application using the COM API via WIL. As far as the client code was concerned, COM was a detail encapsulated by the C++ facade we created: Not a COM pointer to be…

By Brian Rogers | 17 July, 2023 | design, native, testing | 1 Comment |
Read more

Stay COM: C++ and encapsulation

In the previous post, we discussed using WIL to tame COM APIs. At the end, we had translated a Time Trigger sample from the Task Scheduler API from a very C-like structure into something approaching modern C++. Still, that example…

By Brian Rogers | 3 July, 2023 | design, native | 1 Comment |
Read more
  • « Previous
Copyright ©2025 WriteAsync .NET | Theme by: Theme Horse | Powered by: WordPress