.NET R&D Digest (April, 2022)

One more month out, still eight to go and looks like these months have a lot of .NET. C# 11 is coming closer (and it won’t include parameters null-checking). Microsoft Build is going to happen in just a few weeks and recently the amazing thing happened – a first release of CoreWCF, which is going to be supported by Microsoft.

However, one thing doesn’t change – every month there is a new issue of .NET R&D Digest. This time the issue includes bits of software development, hardware, .NET, Windows and security.

Enjoy and May the 4th be with you!

Software Development

  1. Bottleneck #02: Talent (by Tim Cochran and Roni Smith)
    Organisational scale up is a challenge with many caveats and hidden issues. During hyper-growth phase you can drown in technical debt or your growth might be limited by number of people you have. In this post Tim Cochran and Roni Smith describe the second of bottlenecks which startups (and small organisations too) face during hyper-growth phase — how to keep and attract talent. The post is very detailed and touches a lot of important topics from company culture to hiring and interviews. 

Hardware

  1. Modern Microprocessors. A 90-Minute Guide! (by Jason Robert Carey Patterson)
    Do you know what constitutes a modern microprocessor? Why do they need caches? What is branch prediction? These questions might sound a bit “too technical” and “geeky” because if you haven’t studied the hardware architecture they sound too advanced. However, while implementations of these things are mind blowing the high-level concepts can be understood by anyone and this amazing post by Jason Robert Carey Patterson explains them well. Here, you will find a high-level description of modern microprocessors architecture (or different types) with explanations why they are made that way. Highly recommended.
  2. Disaggregated Memory – In Pursuit Of Scale And Efficiency (by Piotr Balcer)
    Is server in data center so different from commodity computers we have at our homes? From the first glance it might seem that the answer is — no (but they definitely bigger). However, it is not so simple. Many problems which doesn’t exist in home computers (ex. efficiently distributing memory between multiple virtual machines) are significant when it come to data centres with hundreds of servers. Hardware vendors try to solve this kind of problems by introducing a new, specialised software and hardware. In this post Piotr Balcer describes a concept of possible implementation of disaggregated memory, which might be significant leap forward efficient memory usage at scale.

.NET

  1. Dictionary implementation in C# (by Paula Wojciechowska)
    C# Dictionary<T> is a hash table (or map). Knowing that you can theoretically explain how it works (hash function, buckets and so on). However, do you know how it is implemented internally? How, for example, dictionary is resized? In this post Paula Wojciechowska describes the internals of C# Dictionary<T> (add, remove and resize operations) by using infographics and detailed explanations of every step taken. 
  2. Nullable reference types in C# (by Maarten Balliauw)
    Modern compilers are powerful tools. Besides literally compiling source code into executables and libraries they also ensure sanity and correctness of the code. However, depending on the language and its rules compiler might be more or less strict about things. In case of C# – we as developers have a lot of freedom which also mean — we have a lot of possibilities to make mistakes, like dereferencing a null. That is why C# team introduced nullable annotations, a volunteer way, to tell compiler more about your code and help you to avoid null reference exceptions. In this series Maarten Balliauw dives into the topic and explores what makes nullable annotations strong and worthy of investment and what still have to kept in mind. The series is very detailed with lots of code samples and descriptions.
  3. Tracking down a hanging xUnit test in CI: building a custom Test Framework (by Andrew Lock)
    Handling timeouts is tricky no matter where you need them to be — when making an API call, running an application or executing a unit-test. The problem comes from the fact, that you not only need to “stop waiting” but also make ensure the underlying process (or thread) is prevented from doing future progress (terminated or stopped if it is possible). Here is the part which is hard to make right and therefore it is sometimes not implemented in the underlying frameworks and left to developers. In this post Andrew Lock describes how he and his colleague Kevin Gosse fought hanging xUnit tests on the CI and how they managed to implement a mechanism to detect hanged tests.
  4. Running JavaScript inside a .NET app with JavaScriptEngineSwitcher (by Andrew Lock)
    We can run JavaScript in a browser or in a by using NodeJS. But is it possible to run it using .NET? Turns out the answer is YES! In this post Andrew Lock demonstrates how you can execute JavaScript code in .NET console application with just a few lines of code — thanks to rich ecosystem of available packages which do all the heavy lifting. As usual the post is full of links, code samples and detailed descriptions.
  5. Warning on lower case type names in C# 11 (by Jared Parsons)
    Development of software which is used by enormously large amount of people is complicated. Now imagine that your software is actually used to … develop more software. This is a case of any language compiler. In this short post Jared Parsons describes the reasons for introducing an “unnecessary“ (at the first glance) warning about lowercase type names. The comments provide future insights on why the decision is made.

Windows

  1. Mysteries of the Registry (by Pavel Yosifovich)
    Everyone who has tinkered with Windows have seen “The Registry” (usually through RegEdit utility). But what is inside it? Is it a tree or a file? In this post Pavel Yosifovich dives into Windows registry topic and describes hives, links and how user and kernel views of the registry differ.

Security

  1. To initialize or not to initialize — the dirty pipe vulnerability (by Gergely Eberhardt)
    Computer programs always do what they are coded to do. It might sound crazy but this is exactly the source of most bugs and vulnerabilities because any minor mistake in the program creates a way to exploit your application. In this post by Gergely Eberhardt you might find one of such examples, which lead to a critical vulnerability just because not all structure fields where initialised. 

Tips

  1. Forcing HttpClient to use IPv4 or IPv6 addresses (by Gérald Barré)
    How do you think — are you using IPv6 in you applications? If you aren’t configuring anything explicitly then sometimes you might use it when making HTTP calls. However, what to do if you need to make sure there is no IPv6 in your app? In this post Gérald Barré shares a tip of how to hook up into HttpClient implementation and enforce IPv4 usage.
  2. Working on two git branches at once with git worktree (by Andrew Lock)
    Efficient use of development tools is a key to productive and less frustrating working conditions. However, sometimes we are simply constrained by the existing set of tools or we have a niche workflow which none of them is optimised to handle — like working on multiple git branches at once. In this post Andrew Lock share his experience on how to increase productivity while keeping multiple active git branches. Beside being a practical advice this post also includes information about git and what you can with it.
  3. How to list all routes in an ASP.NET Core application (by Gérald Barré)
    In this post Gérald Barré demonstrates how you can use infrastructure services to quickly print information about all routes in the application.

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