.NET R&D Digest (September, 2021)

Today is the first day of October and by a share coincidence, today is Friday. Could you imagine a better day for a new issues of .NET R&D Digest? I can’t 🙂

This issues contains bits of software development, diagnostics, learning, DevOps and of course a lot of .NET (why wouldn’t it?)

Have a nice read and have a great weekend!

Interesting 

  1. OpenAI Codex
    How do you think is it possible to write an app by simply writing up all business rules? It turns out – the answer is yes (watch the video). Of course it is just a beginning but looks very impressive.

Software Development

  1. Patterns of Legacy Displacement (by Ian Cartwright, Rob Horn and James Lewis)
    A lot of business functions are supported by legacy software. This is natural because software don’t age – it continue to work. However, business needs are changing, surrounding is changing and supporting legacy software becomes costly and hard. So how to replace it? In this post Ian Cartwright, Rob Horn and James Lewis share a set of patterns, ideas and examples of what should be done on both technical and organisational level to successfully replace legacy systems.

.NET

  1. Preview Features in .NET 6 – Generic Math (by Tanner Gooding)
    .NET has generics since it’s early times (v2.0), however, while generics allow us to write reusable components like collections, repositories and so on, they are quite limited in writing generic algorithms which would work on any type who has required operations. However, looking at this post I feel like .NET is one step closer to generic programming. In this post Tanner Gooding describes a new preview feature – static abstract interface methods which essentially allow to setup a contract between type and type consumer, which in turn allows to write generic mathematical expressions which work for any compatible type 🙂
  2. File IO improvements in .NET 6 (by Adam Sitnik)
    Accessing file system is generally a slow operation (compared to accessing memory of course). So in many cases we are “prepared” for performance impact. But does it have to be that way? The answer is no. In this post Adam Sitnik describes a set of improvements introduced into new version of .NET which result into a significant, really significant performance boost. The post is full of code samples, detailed explanations of every change and benchmarks to demonstrate the gains.
  3. New .NET 6 APIs driven by the developer community (by David Fowler)
    Every major release of any big product usually contains so many features that it is almost impossible to present them without megabytes of text. That is why upcoming release of .NET 6 is being covered from all different view – performance, file system, etc. In this post David Fowler shares a set of change introduced in .NET because they were driven by community. These changes touch multiple areas – file system, native memory, LINQ and so on. Besides being informative it is also a very positive post 🙂
  4. Using C# 9 records as strongly-typed ids (by Thomas Levesque)
    Usually when we think about a bug we think about an issue in application logic. Why? Because in strongly typed languages like C# it is hard to make typo kind of issue – compiler will immediately catch it. However, it is still possible to accidentally swap userId and orderId because … well they are usually of the same primitive type – int or long. In this series Thomas Levesque demonstrates a way of how to utilise new C# record types and C# type system to exterminate even a possibility of such issues. This series is a full stack integration of strongly typed id’s into code, ASP.NET and Entity Framework.
  5. Conversation about the .NET open source project (by Claire Novotny, Dan Moseley, Immo Landswerth, Kevin Pilch, Matt Mitchell, Stephen Toub and Rich Lander)
    7 years ago .NET became open-source. This changed a lot for us, developers. But what have changed for people who actually develop .NET? In this post Claire Novotny, Dan Moseley, Immo Landswerth, Kevin Pilch, Matt Mitchell, Stephen Toub and Rich Lander from .NET team share memories and current view of how open sourcing .NET have changed the product and their workflows.
  6. Downloading artifacts from Azure DevOps using .NET (by Andrew Lock)
    Replacing manual actions with automation is nice. Automating an error prone manual step is very nice. But doing such using .NET is amazing 🙂 In this post Andrew Lock shares a story of automating  one of the release pipeline stages by directly interacting with Azure DevOps through the API. This post isn’t only about the code (while there are good and detailed samples) but more about the story of how to interact and integrate with mature system which survived a few rebranding.
  7. String Interpolation in C# 10 and .NET 6 (by Stephen Toub)
    String manipulations are one of the most common operations any application does. We create and print string all the time – logs, traces, HTTP calls and so on. For a long time string.Format was the best way to substitute values into non-complete messages. However, it wasn’t friendly, so C# introduced support for string interpolation which with a few exceptions was a syntax sugar for string.Format calls. But in .NET 6 it is not the proxy anymore. In this post Stephen Toub describes and demonstrates changes and improvements of string interpolation introduced in C#10, which to be honest, make it a preferred way for formatting.
  8. Dealing with Modules, Assemblies and Types with CLR Profiling APIs (by Christophe Nasarre)
    Have you missed COM or buffer allocations? 🙂 If the answer is yes then this post is definitely for you. In this post Christophe Nasarre continues the series (this is a second post) about writing a custom CLR profiler. This time the post is focused on explaining structure of assembly and module metadata to describe types and methods. The post is full of code snippets and easy to read, so don’t be afraid of COM.
  9. Introducing DevOps-friendly EF Core Migration Bundles (by Jeremy Likness)
    Updating database schema is dangerous not only because you can lose some data but also because there is no pretty way of doing it. When using Entity Framework we can generate a migration script but how we should apply it? Should we do it manually? Should we use sqlcmd or CI pipeline? What about update database CLI command? Traditionally there is no right answer – just options. In this post Jeremy Likness introduces a new option to apply migrations to a database, an option which is much more friendly to CI – migration bundles. 

Watch & Learn

  1. Webinar “Why you should understand memory dumps?” (by Konrad Kokosa and Sebastian Solnica)
    Memory dump is one of the major things in a diagnostic of production system. It can help you to find deadlocks, identify memory leaks and of course find the root cause of an application crush. In this webinar Konrad Kokosa and Sebastian Solnica demonstrate how you can get and inspect memory dumps from .NET applications. Besides describing the technics, Sebastian also shows what tools are available for you as developer and how they work in a cross platform world.
  2. Dotnetos Essentials
    Paying for a course is a risk – you never know what would you get. That is why it is very cool when you can have a sneak peek of what is inside the course, just to make sure it is what you need. Dotnetos do great courses and is my personal opinion, however with «Dotnetos Essentials» you can make up your own opinion – just try a few lessons from each of the courses and see whether they are good for you.

Tips & Tricks

  1. Locating MSBuild on a machine – Meziantou’s blog (by GĂ©rald BarrĂ©)
    Continues Integration scripts include not only build and test stuff but also such non trivial steps like detecting installed software on the machine or locating script directory. In this tip Gérald Barré describes how you can write a PowerShell script which can easily detect MSBuild location on the machine.

One thought on “.NET R&D Digest (September, 2021)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s