#530 – November 03, 2024
Wait, C# has a borrow checker?
A comparison of Rust’s borrow checker to the one in C#
13 minutes by em-tg
This article compares memory safety features in C# and Rust, focusing on C#'s ref safety system. The author demonstrates how C# implements similar memory safety checks to Rust's borrow checker, but with different trade-offs due to C#'s garbage collection and simplified lifetime rules.
🎉 JetBrains Rider is now free for non-commercial use
sponsored by Jetbrains
Contribute to open source, learn through self-education or courses, record educational podcasts, or grow your pet project easily with Rider, a fast and powerful cross-platform IDE for .NET and game development. Download and start today!
Best Practices for Using Action and Func
4 minutes by Mohamed Tayel
A comprehensive guide on using Action and Func delegates in C#, two built-in delegate types that simplify method references and enhance code readability. Action delegates handle methods that don't return values (taking up to 16 input parameters), while Func delegates are used for methods that return values.
Implementing Health Checks in ASP.NET WEB API
4 minutes by Abdul Rahman Shabeek Mohamed
This article explains how to implement health checks in ASP.NET Core Web API applications. Health checks are monitoring tools that help verify the status of an application and its dependencies through regular checks.
Antipatterns in Loops
4 minutes by Sarah Dutkiewicz
Learn to identify and avoid common loop antipatterns in C#. Improve your code's efficiency and readability today.
Enumerating concurrent collections with snapshots in C#
2 minutes by Tore Aurstad
While standard C# collections throw InvalidOperationException when modified during iteration, concurrent collections allow modifications while being enumerated. To ensure consistent iteration results with concurrent collections, you can create a snapshot using ToArray(), though this operation is costly as it locks and copies the entire collection.