December 14, 2017

The C# Language - Overflow Checking for Integral Operations

The C# language has been around for over 15 years. It started off as a Java ripoff and evolved into its own language. Some parts of the language I use daily: enumerators, generics, async/await. Other parts lurk in the shadows until the rare moment when I need to put them to use. One such part is overflow checking for integral operations. Compiler Option By default, integral operations are not checked for overflows either by the C# compiler or at runtime. Read more

October 22, 2017

SpecFlow NUnit3 Generator Plugin

I recently created a SpecFlow plugin to solve a peculiar problem with NUnit test code generation. The issue is SpecFlow will generate test code that doesn't compile when the .NET project containing the SpecFlow scenarios has a default namespace with the word NUnit. For example, if your project has the namespace IntegrationTests.NUnit, then you'll receive the following error when trying to build. The type or namespace name ‘Framework’ does not exist in the namespace ‘IntegrationTests. Read more

August 15, 2016

TaskCompletionSource - Bridging the Gap Between Old and New

In the latest versions of the .NET Framework, asynchronous work is represented by the Task class. A task is similar to a future or promise in other languages. You can create one in many ways the most common being Task.Run(). The result of a task is exposed by the Task.Result property. If the work is complete, then the property immediately returns a value; otherwise, it blocks until the operation is finished. Read more

July 8, 2016

Top 6 Industry Shifts During My IT Career

In the fall of 1999, I dropped my plans to attend grad school to embark on a career in IT. The industry has changed considerably since then mostly for the better. In fact I've never been more excited to be a software developer. As part of a personal retrospective on my career, below are my thoughts on the top six shifts in IT. By a “shift” I mean a change that has profoundly affected the way developers go about their daily work. Read more

December 9, 2015

A Short and Easy Introduction to .NET's Task Class

Task.Run You can use Task.Run to schedule a delegate to run on the thread pool. The method returns a new task, and if the work is complete, the result will be available via Task.Result. If not, Task.Result will block until it is complete. Task.ContinueWith You'll want to avoid accessing the Task.Result property because it will block until the result is ready. In the previous example, the UI will hang for about 2000 milliseconds before updating the label with the result. Read more

October 26, 2015

SpecFlow Tags Done Right

In a previous post, I covered scoped bindings in SpecFlow and ended with an example of how not to use tags. In this post, I'll cover the “right way” and demonstrate how to avoid coupling features to step definitions. But first, a quick primer on tags. What Are Tags? Tags are used in Gherkin to mark features or scenarios. They begin with the @ character in Gherkin, but in step definitions the @ is removed. Read more

© Joe Buschmann 2020