One more month out means one more issue of .NET R&D Digest 🙂
This issue includes bits of .NET, .NET Internals, Computer Science, Visual Studio, Cloud and Software Engineering.
Have a nice read!
Computer Science
- Faster: A Concurrent Key-Value Store with In-Place Updates (by Badrish Chandramouli, Guna Prasaad, Donald Kossmann, Justin Levandoski, James Hunter and Mike Barnett)
In C#, when we need a concurrent key-value storage we usually useConcurrentDictionary<T>
. It is simple and it is great for a lot of cases. However, when we need to handle huge amount of data it is common to use external components like Redis. But what if we need something that can handle tons of requests, handle data larger than memory and at the same time be a part of our application? In this paper Badrish Chandramouli, Guna Prasaad, Donald Kossmann, Justin Levandoski, James Hunter and Mike Barnett present a FASTER, A Concurrent Key-Value Store which supports in place updates, larger than memory data, state recovery and much more. But this isn’t all – FASTER is written in C# and can be used in your application as usual night package. So next time you need concurrent key-value store to handle tons of data and requests give FASTER a try.
Software Development
- Maximizing Developer Effectiveness (by Tim Cochran)
How effective your development workflow is? This question isn’t an easy one. In this post Tim Cochran describes common examples of ineffectiveness in developer’s workflow and how it affects developer’s productivity and an organisation. While the post is focused primary on organisations, many of the described things are applicable locally, even within the teams. - On the Diverse And Fantastical Shapes of Testing (by Martin Fowler)
There are unending debates of what unit-test is and what percentage of test coverage should be. In order to answer these questions, there are different «shapes» of test which show proportion of each types of tests. In this post Martin Fowler describes a few of such shapes and dives into a source of above-mentioned disagreements by describing different understanding of unit- and integration-tests and pointing to the real problem we should concentrate on.
Visual Studio
- Debugging a .NET assembly without the source code with Visual Studio (by Gérald Barré)
Each version of Visual Studio brings something new, or something which simplifies things we tend to do with other tools. In this post Gérald Barré shares a tip about how you can use Visual Studio to decompile external .NET assembly without PDB files and … debug it 🙂 if you need.
.NET
- Build your own unit test platform? The true story of .NET nanoFramework (by Laurent Ellerbach)
What it takes to write a unit test platform? What components should you have? These questions thrill the imagination. In this post Laurent Ellerbach describes how these questions were solved for .NET nanoFranework project. The described test platform besides being based on custom build of mscorelib (which is already cool) also has an ability to run tests on both real devices and Windows PC (emulation) which make the opening question even more interesting. - Benchmarking 4 reflection methods for calling a constructor in .NET (by Andrew Lock)
Creating an object is the second step each .NET developer takes when learning the platform (the first one is usually Console.WriteLine). So, what a surprise can be in such trivial action? It turns out — a lot. There are many interesting ways to create objects in .NET. In this post Andrew Lock describes four different approaches of how to instantiate an object in runtime whose type isn’t know at compile time. Besides detailed description, this post also includes benchmark results presented approaches. - Conversation about the .NET type system (by David Wrighton, Jared Parsons and Rich Lander)
Every programming language has a type system. But what type system really is? What kind of type system C# and .NET have? In this post two .NET runtime engineers David Wrighton, Jared Parsons and Rich Lander discuss the fundamental and future decisions made in C# language and what drives them. The post is made is form of conversation so there are multiple options on each question, which allows you to see the same thing from multiple angles. - Different ways to check if a value is null in C# (by Gérald Barré)
Checking object for null is probably a most common operation in C#. Therefore, it might sounds strange but there are more than one way to do it and all of them are somehow different. In this short post Gérald Barré enumerates currently available approaches to check object for null and highlights the difference between them. - Conversation about .NET interop (by Aaron Robinson, Elinor Fung, Jeremy Koritzinsky, Tanner Gooding and Rich Lander)
If you are a long time .NET developer, you probably heard of interop and even used it. But what interop really is? Is it limited to «pinvoke»? Is it slow? In this post four .NET engineers Aaron Robinson, Elinor Fung, Jeremy Koritzinsky, Tanner Gooding and Rich Lander discuss what interop is, how it is related to API and ABI concepts, what to expect from it in future and much more. The post is made is form of conversation so there are multiple options on each question, which allows you to see the same thing from multiple angles. - Exploring .NET interactive notebooks with VS Code (by Andrew Lock)
Console application was a default way of trying things in .NET for years. However, this approach always lacked ability to include a story in it — write a description, put a link and so on. In this post Andrew Lock explores a better way of trying things using .NET interactive Visual Studio Code extension, which allows to achieve Jupiter notebook like experience but with .NET. - Running my .NET nanoFramework for 8 years on a battery (by Laurent Ellerbach)
What can IoT device do? If you’ve never worked with such devices then you might probably think something like blinking a led or beeping a sound. However, modern devices are capable of much more. In this post Laurent Ellerbach describes what Micro Controller Unit (MCU) and it is different from CPU we are used to, what kind of workloads you can run on such devices and share a personal experience of running some of these workloads for years (yes, literally, for years) using C#, .NET and Azure. - Custom bindings with Azure Functions .NET Isolated Worker (by Maarten Balliauw)
Serverless is a nice development concept where you, as a developer, do exactly a thing you need, no “dances”, just pure value. However, in order to make this happen there should be “infrastructure “ around — in case of Azure Functions – bindings and runtime. In this post Maarten Balliauw describes how you can write a custom Azure Function binding and how you can link it to a new, isolated worker model introduced in .NET 5. The post is full of code snippets, details and useful links. - Using DateOnly and TimeOnly In .NET 6 (by Steve Gordon)
It quite common to see new types being introduced with new framework release. Usually, these types represent new functionality rather than significantly extending something existing. However, this time it is the later case. In this post Steve Gordon does a short introduction into two new basic types introduced in .NET 6 – date only and time only. While purpose of these types is obvious it is a pleasure to seem them in action (especially if you have experience representing a date only value with DateTime). As usual, the post includes code snippets and detailed explanations. - Finding concurrency bugs in a .NET application using Coyote (by GĂ©rald BarrĂ©)
Tests are foundation of quality code. However, while we can test behaviour of individual methods, or components to ensure they do what they are supposed to do, there is no easy way to write a test that could find concurrency bug — except may be running a stress test for a few hours. In this post GĂ©rald BarrĂ© does a short introduction to a new tool from Microsoft Research which is designed to help finding concurrency bugs – Coyote. In this post you will find an example of how to get started and write your first test to detect a deadlock. In addition, the post includes a set of links for more info. - Convert SVG files to PNG or JPEG using .NET (by GĂ©rald BarrĂ©)
Sometimes simple problem requires creative solution. This is especially true when it comes to conversion scenarios. In this post Gérald Barré describes how you can creatively approach image conversion scenario by demonstrating how you can convert SVG to PNG using a non-standard thinking, and .NET.
Watch and Learn
- ASP.NET Community Standup – The 12 Factor App (by Jon Galloway, Shayne Boyer, Glenn von Breadmeister and Jeffrey Richter)
What makes a great service (considering a technology aspect)? A framework? Ability to run in Cloud? Or it is something more? In this community stand-up Jon Galloway, Shayne Boyer, Glenn von Breadmeister and Jeffrey Richter talks about the famous 12 factors — what they really mean, what of these factors are already implemented by .NET and why these factors are sign of a good service.