String Performance: Retrieving a Substring

The post discusses optimizing string concatenation in .NET by using the Span type, which significantly enhances performance and reduces memory allocation.

Collection Performance: Adding Items To a Dictionary

The excerpt from "Rock Your Code" discusses two methods for adding items to a Dictionary in .NET: Add() and TryAdd().

Collection Performance: The Fastest Way To Iterate Over a Collection in .NET!

Discover the quickest method to iterate over a collection in Microsoft.NET with this article, which includes performance benchmark tests.

Rockin’ the Code World Season 4: Special Guest Leslie Richardson

On Saturday, January 13th, 2024 at 10:00 PST on C# Corner TV, join David McCarter for show #94 featuring Leslie Richardson, Senior Product Manager at Microsoft. The interview will cover Visual Studio productivity/debugging, C# Dev Kit, .NET Aspire Dashboard, and Geek Humor. The episode also promotes charity and blood donation.

Rock Your Code: Coding Standards for Microsoft .NET (8th Edition)

The 8th edition of the book, Rock Your Code: Coding Standards for Microsoft .NET, is available on Amazon. It consolidates Microsoft .NET coding standards and provides supplementary directives. Drawing insights from Microsoft’s code inspection tools, the book covers topics such as project setup, naming standards, class design, coding style, and more. The book's purpose is to facilitate superior code quality and swift integration of new team members. It's designed for use with Visual Studio 2022, C#, and .NET 8.

Microsoft .NET Code Analysis: Add Explicit Cast in foreach() Loops

The article highlights the importance of adding an explicit cast in foreach loops when dealing with collections to avoid potential runtime issues caused by hidden casting. It also suggests simplifying the code using LINQ and optimizing performance by using `AddRange()`.

Rockin’ the Code World Season 4: Special Guest Simon Painter

Join the 93rd show on C# Corner TV on December 16th, 2023, featuring Simon Painter, Senior Software Developer for Mueller Dairies, Ltd. The show includes an extensive interview with Painter, discussions on functional programming in C#.

Microsoft .NET Code Analysis: Make Collection Properties Read-Only

The article discusses the common programming practice of providing access to data collections through properties and highlights the issue of mutability in such properties, which can lead to undesirable collection replacements. To adhere to best practices, the article recommends either removing the property setter or using the init modifier to make the property read-only, emphasizing that read-only properties with collections are supported by binary and XML serialization.

Microsoft .NET Code Analysis: Simplify LINQ Expressions

The article discusses simplifying LINQ expressions in source code by eliminating unnecessary Where() methods and placing predicates directly in FirstOrDefault(). This not only improves code readability but also demonstrates a 1.9 times performance improvement in .NET 8.

Microsoft .NET Code Analysis: Utilize the Pattern Matching ‘not’ Operator

The article discusses how developers can improve code performance and readability by replacing explicit type checks with pattern matching, eliminating the need for redundant type conversions and enhancing code efficiency.