.NET R&D Digest (May, 2022)

Today is the first day of summer and summer is a great time to learn new things and prepare ourselves for autumn season of conferences and new release of .NET.

That is why, this issue of .NET R&D Digest includes bits of computer science, software development, .NET (and some new .NET technologies), Windows and a bit of project management!

Have a nice read!

Computer Science

  1. Branch prediction (by Dan Luu)
    Abstraction is an essence of today’s technological world. A lot of things (especially in hardware) are extremely complex and can’t be manufactured without special tools and machines. However, we use them and most of the time we don’t think about theirs complexity. The same works for modern CPU’s. We run programs and they just work. However, CPU does a lot of magic to run them efficiently and one of such magic things is branch prediction. In this post (or transcript to be precise) Dan Luu describes the basics of what branch prediction is and explains what challenges it has and how they are compensated.
  2. A whirlwind introduction to dataflow graphs (by Fabian Giesen)
    Every computer program has an algorithm behind it. Even if you don’t realise it (ex. read input, sum numbers and return the result is also an algorithm). The algorithms tend to have critical path — a set of actions which contribute to the longest part of the algorithm. There are number of factors which determine the length of critical path. In this post Fabian Giesen makes an amazing introduction to dataflow graphs, explaining what they are and how they can be used to understand program flow and bottlenecks.

Software Development

  1. Transitional Architecture (by Ian Cartwright, Rob Horn and James Lewis)
    One of the key to successfully replace legacy software is a gradual transfer of legacy system’s responsibilities to the new system. One of the way of doing so is to introduce temporary components which will be removed after the transition is completed. In this post by Ian Cartwright, Rob Horn and James Lewis describe the process of introduction of such temporary components to establish transitional architecture, replacement of legacy components and their disposal.

.NET

  1. Regular Expression Improvements in .NET 7 (by Stephen Toub)
    Every release of .NET is better than previous (at least in case of performance). Every post from Stephen Toub is an amazing deep dive into .NET’s internals and performance. This time he dives into performance improvements of regular expressions. Besides highlighting the speedups introduced in .NET 7 he also explains a lot of interesting internal details about the how regex engine «see» patterns. As usual the post is full of examples, invaluable details and benchmarks.
  2. A deep-dive into the new Task.WaitAsync() API in .NET 6 (by Andrew Lock)
    Writing code on top of the mature framework is great — you have all the methods which do all the magic. But how this magic is implemented? What is hidden behind simple and neat method signature? In post Andrew Lock explores internals of Task.WaitAsync method and describes how it accomplish the goal of providing support for timeout and cancellation.
  3. Unusual optimizations; ref foreach and ref returns (by Marc Gravell)
    In a last few years .NET and C# have improved a lot in area of low level performance. These improvements aren’t noticeable in most of the applications but as any tool — it is great to have them when needed. In this post Marc Gravell describes how using C# you can significantly improve foreach performance in certain low level scenarios. 
  4. How To Fix SqlException Database Is Not Currently Available On Azure (0x80131904) (by Dawid Sibiński)
    In my experience, when working with Cloud the default assumption is that cloud services are more stable and predictable than something installed on nearby servers or even local machine because “there are people to watch over it”. That is why receiving “service unavailable” exceptions from Cloud services feels so odd and unexpected. In this post Dawid Sibiński shares his story of encountering an unexpected issue with quite a standard Azure application.
  5. Why isn’t my ASP.NET Core app in Docker working? (by Andrew Lock)
    Modern development environment has many layers and most of these layers are transparent to us, developers. We can easily run a Linux application in Docker container on Windows without even noticing it. However, it is important to remember how much glue there is between these layers. In this post Andrew Lock share a development story of how can you run ASP.NET Core application on CentOS by building your own Docker image.
  6. Generating sortable Guids using NewId (by Andrew Lock)
    Relation between domain object and database entity is usually established by unique identifier of some sort. These identifiers are either provided by a client or generated by the database. When generating id’s on the client the obvious choice is GUID because … well it is unique. However, as any solutions it has own downsides. But may be there is another way which might preserve a benefits of GUID’s and avoid some of the downsides? In this post Andrew Lock demonstrates how you can use a NewId package to generate GUID like unique identifiers on the client and avoid some of the issues introduced by using natural GUIDs.

Windows

  1. Zombie Processes (by Pavel Yosifovich)
    When process is terminated all of its resources are released. Do they? Is there a possibility that some process resources might remain to be allocated? In this post Pavel Yosifovich describes what zombie process in windows is and what potential impact they might have on the system.

Learn

  1. Build mobile and desktop apps with .NET MAUI
    .NET MAUI is relatively new technology for building cross-platform Mobile and Desktop applications. It has been in preview for a while and recently was added as a new target in Visual Studio. However, for technology to be adopted it is critical to have a good and reliable source of knowledge or community. Many time, many technologies have failed to introduce something like that from the very beginning but this time it is different — this time, there is a learning path! 

Tips

  1. Sharing coding style and Roslyn analyzers across projects (by Gérald Barré)
    When it comes to code, consistency is one of the keys which affect its readability the most. Consistency might come in form of unified architecture or even code style. Both are important. In this post Gérald Barré share a tip of how you can create a NuGet package to share code style and Roslyn analysers configuration across different projects.

Books

  1. Scrum and XP from the Trenches – 2nd Edition (by Henrik Kniberg)
    If you are interested in learning something about Scrum. Well, then this book by Henrik Kniberg might be a good start. It is easy and entertaining to read (especially 2nd Edition with comments). 

Tools to Explore

  1. Coyote
    Concurrency bugs are hard to find. The reason is simple — you need to reproduce a chain of events (or to be accurate) which causes multiple actors to interfere with each other. Coyote is a tool which is intended to help with identification of such bugs by tweaking execution of your code in way it helps to reveal race conditions and other common concurrency issues.

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