Software rot is inevitable if projects are not maintained with care. It is nice to think that in today’s write once, run anywhere world, a rock-solid application with no planned changes can continue to work perhaps without even recompiling; of…
Cross-platform without complexity: finishing up
Our cross-platform project has interoperable C++ and .NET code. However, the command line and IDE experience still only accounts for the C++ side. Let’s start with the IDE. First, a bit of bad news — there doesn’t seem to be…
Cross-platform without complexity: .NET interop
The cross-platform project has a shared library now. Wouldn’t it be fun to try to build an interop project using P/Invoke with this library? To account for the addition of .NET projects, we’ll need to revisit the project structure: inc…
Cross-platform without complexity: shared libraries
Continuing from our cross-platform project skeleton, let’s try to add a shared library. Windows users may know these as dynamic link libraries (DLLs), while Linux users would recognize them as shared objects (.so). To make things even trickier, most Windows…
Cross-platform without complexity: command line
At this point we have a Windows build and remote Linux build working from Windows in the Visual Studio IDE. This is all good and it’s hard to beat VS in terms of productivity while actively developing the code. However,…
Cross-platform without complexity: remote Linux
Previously, we showed how to enable the Visual Studio IDE to work with an ostensibly cross-platform CMake project. Today we will prove that the project indeed can work on a non-Windows platform — at least as much as is possible…
Cross-platform without complexity: VS IDE
Let’s say you want to start a modern C++ project. However, you have some requirements in mind that may be hard to achieve. First, the project should support development in the Visual Studio IDE but also provide a simple command…
Switch expression performance: part 2
Previously we looked at the performance of simple switch statements and expressions. Today we will consider switch expressions with when clauses. This example shows a simple letter grade calculator as might be defined for a US high school: The first…
Switch expression performance: part 1
Being the good multi-paradigm language that it is, C# has adopted features from across the programming spectrum. One recent addition of the functional programming variety is pattern matching, first arriving in C# 7.0 with enhancements in C# 8.0. The latter…
Null operator performance
The null-conditional (AKA “Elvis”) operator and null-coalescing operators were introduced in C# 6.0 and C# 2.0 respectively. They’ve been with us for years and help make our code more concise. But have you ever wondered about their effect on performance,…