.NET R&D Digest (April, 2024)

Every month I write a small introduction to the new issue of .NET R&D Digest. Sometimes, it is something abstract and sometimes it is something related to the trends and changes of related technologies. This time, these keystrokes will be dedicated to the issues itself. 

The issue you are going to see happened to be a bit… strange — with multiple sections, each having one or two links and with unusually short .NET section — just two series of wonderful content about .NET and C#. 

This doesn’t mean there is no .NET in the issues, in contrary, in the Watch & Learn section you will find a two videos — one about LINQ and one about async/await. These are a quintessence of .NET internals knowledge and a great demonstration of effecting development workflow. I highly recommend you to watch both of them, and I hope you will enjoy this «unusual» issue of .NET R&D Digest.

This issue includes bits of software development, C#, .NET, math, Windows, performance, diagnostics, tools, testing, software design and a lot of .NET internals.

Enjoy!

Software Development

  1. Measuring Developer Productivity via Humans (by Abi Noda and Tim Cochran)
    Measure, measure and once again — measure. These are the favourite words of any performance expert in software engineering. Why? Because, measurement is the only way to understand what works (and why) and what doesn’t. The same logic applies far beyond application performance, however, in other areas measuring something can be much harder. In this post Abi Noda and Tim Cochran describe a way of how you can measure development productivity of you teams in the organisation by using a combination of qualitative and quantitative metrics. The post goes deep into the topic and provides a detailed explanation of the difference between qualitative and quantitative metrics and how to use them to truthfully measure development productivity without overloading engineers with unnecessary and misleading orienteers.
  2. Uncovering the Seams in Mainframes for Incremental Modernisation (by Alessio Ferri and Tom Coggrave)
    One of the advantages (and disadvantages) of software products is that they keep working. Essentially, if you keep the right hardware and related software, nothing prevents your product from running infinitely. What is a disadvantage then? Well, the technologies, approaches and overall software architecture gets older, which leads to longer time to change, more powerful hardware, inability to adapt to the load and so on. These problems can be solved by migration, slow and costly process which can take a few years to complete (especially if we are talking about huge enterprise software). Taking this step means accepting the trade offs and readiness to do new and support the old. In this post Alessio Ferri and Tom Coggrave describe a practical case of migration of huge mainframe software by exploiting multiple approaches described in the great Patterns of Legacy Displacement series. The post is very detailed and demonstrates how you can approach the complex migration and what trade off you most probably will have to take.
  3. Syncing a git branch between Windows and WSL filesystems (by Andrew Lock)
    Nowadays, a lot of tools and instruments  are cross-platform, meaning you can use them on almost any platform you might want to. However, cross-platform development is still hard and quite painful but thanks to the resourcefulness and functionality of the tools there are workarounds. In this post Andrew Lock describes how you can synchronise git repository between Windows and WSL using the distributive nature of the git itself.

.NET 

  1. C# 12: Collection expressions and primary constructors
    Some more C# 12 (by Tom Deseyn)
    C# is a continuously evolving language. Every release brings something new. Sometimes, features are great and sometimes they are questionable. However, it is for developers to decide, but to make this decision it worth looking closely on these features first. In this series Tom Deseyn describes major features of C#12 — primary constructors, collection initialisers, inline arrays, lambda params and defaults, ref readonly and UnsafeAccessAttribute. The series covers all the major cases of how these features can be used including some of the peculiarities you might encounter along the way.
  2. Rendering Math in HTML: MathML, MathML Core, and AsciiMath
    Hacking together an AsciiMath parser for .NET
    Creating a .NET AsciiMath parser and using it in a Markdig extension (by Andrew Lock)
    Mathematical equations are one of those things that you can easily write on a sheet of paper but  can’t just show them on a display. There are dedicated software products to create and edit mathematical equations with their own “mathematical language”. There are also multiple text processors which support mathematical equations — LaTex probably the most popular of those. But all these things are either desktop applications or they render equations as documents or images, which leaves an open question — what about the web?! It turns out that these questions were asked previously and there are way to render math in web. In this series Andrew Lock describes how you can render math on web pages using native browser support and third party libraries. Besides focusing on math, the series also touches a very important topics of integrations between languages (running JavaScript in .NET) and how you can share things you do for yourself 🙂 The series is very interesting from the educational perspective and easy to read.

Windows

  1. The Power of UI Automation (by Pavel Yosifovich)
    One of the truth of software is that what you see is not what it is. This is especially true for the user interface where button can be a link and window might not be a window at all. In this post Pavel Yosifovich describes UI automation, a feature of Windows operating systems that allows you to navigate through all of the application UI controls no matter how they are implemented.

Diagnostics

  1. Crash in the crash-analyzer (by Kevin Gosse)
    Modern development tools make, in many cases, application debugging quite comfortable — you can set break points, inspect state, catch exceptions and navigate through call stack. In cases when live debugging is not possible there are many tools which can help you analyse a memory dump. But what can you do if none of these tools are available or none of them can actually be used? Well, there is still a printf 🙂 In this post Kevin Gosse describes an application crush where using printf debugging turned out to be the only option. Besides the interesting case, the post is full of the good insights of how you can approach complex application issues.

Performance

  1. sled theoretical performance guide (by Tyler Neely)
    No matter for how long you work in software development industry there is simply no way to try everything, especially when it comes to performance optimisations. However, it is good to be prepared when the time comes 🙂 In this long guide Tyler Neely describes a set of approaches, ideas and mind models of how to engage in performance optimisation work.

Tips & Tricks

  1. Computing code coverage for a .NET project (by Gérald Barré)
    Code Coverage is an important quality metric. It turns out that now you can collect it using the dotnet-test command 🙂 In this small tip Gérald Barré demonstrates how you can collect code coverage metrics and create code coverage repost by using only dotnet tools and nothing more.

Watch & Learn

  1. Hints and Principles for Computer System Design (by Butler W. Lampson)
    Every computer system was designed to achieve a certain goal, was built to run on certain systems, was expected to be used by a certain group of users, was limited by a certain set of constraints. These are true for every piece of software you might think of (even for a calculator application). However, just knowing about these things isn’t enough to build a sustainable and successful system. So, besides knowing, you need to deeply understand, be able to identify and ready to act accordingly. In this great presentation, Butler W. Lampson describes principles for designing computer systems and explains what constitutes a right goal, what kind of system you might build, what techniques you might use and to what constraints all these choices lead.
  2. Deep Dive on LINQ with Stephen Toub (by Scott Hanselman and Stephen Toub)
    LINQ is one of my favourite features in C#. It makes the everyday work much easier and makes the code much cleaner and simpler to grasp. It is also pretty unique because besides a nice facade it also has a very good performance. In this video, Scott Hanselman and Stephen Toub dive into the internals of what Enumerable, Enumerators and LINQ are and how they are implemented. During the journey, Stephen implements a «simple» Select method by manually doing all of the heavy lifting usually done by the compiler to demonstrate how LINQ really works. The video is very entertaining and easy to follow — highly recommended to watch. 
  3. Writing async/await from scratch in C# with Stephen Toub (by Scott Hanselman and Stephen Toub)
    A long time ago, when .NET was still a framework, a new thing came to existence, two keywords which changed the way how asynchronous programming is done and perceived — async/await. It might be hard to believe but we used to write asynchronous code without it 🙂 Since then, async/await become a thing in many languages and in C# it solidified so well that sometimes it seems indistinguishable from the .NET itself, like something what can’t be reimplemented or done by hand. Well, fortunately this is not so. In this entertaining and educational video Scott Hanselman and Stephen Toub dive right into internals of async/await and reimplement it in just an hour. This video is a treasure of .NET internals — highly recommended to watch.

Leave a comment