dotNetTips

Newsletter Image

Messages

2/26/2024
10 : 14

Mastering Tuples in .NET

dotNetDave posted: " In .NET, a tuple is a lightweight data structure that allows you to group together multiple values of different types. They are particularly useful in scenarios where you need
2/26/2024
9 : 4

String Performance: Comparing Strings with Globalization

dotNetDave posted: " In the String Performance chapter of my code performance book, I demonstrated how to use Compare(), but it's essential to always use it with a StringComparison, as shown
2/21/2024
22 : 14

Rockin’ the Code World Season 4: Special Guest Ante Tomić

dotNetDave posted: " I hope you will join me on Saturday, March 2nd, 2024, at 10:00 PST on C# Corner TV for show #98! For the first time, my very special guest will be Ante Tomić, Senior Software
2/20/2024
21 : 54

Rockin’ the Code World Season 4 Panel Show: The Important of Attending In-Person Conferences

dotNetDave posted: " I invite you to join me on Saturday, March 16th, 2024, at 10:00 PST on C# Corner TV for show #99! For this unique panel episode, I have gathered experts to explore the
2/19/2024
9 : 4

Collection Performance: Avoid Zero-Length Array Allocations

Read on blog or Reader dotNetDave posted: " The .NET team advises avoiding zero-length array allocations due to the associated unnecessary memory allocation. Here's an example illustrating the
2/19/2024
2 : 44

Collection Performance: Iterating Through Reference Value, and Record Types

Read on blog or Reader dotNetDave posted: " Subscriber Content As I predominantly deal with business objects when creating types and collections, during the development of my code performance book
2/19/2024
2 : 24

String Performance: String Compression

Read on blog or Reader dotNetDave posted: " Subscriber Content In programming, string compression proves especially valuable in situations where minimizing data size is critical, such as when
2/13/2024
9 : 4

General Performance Tips for Microsoft .NET: Constant vs Variable

Read on blog or Reader dotNetDave posted: " Updated FEBRUARY 2024 When including numerical or string values in code that remain static, it is advisable to transform them into constants. This is an
2/12/2024
9 : 14

General Performance Tip: Initialize Reference Type Static Fields Inline

Read on blog or Reader dotNetDave posted: " Microsoft recommends initializing reference type static fields inline. Initializing these fields at the point of declaration helps improve code
2/8/2024
16 : 14

Collection Expressions in .NET 8

Read on blog or Reader dotNetDave posted: " Beginning with .NET 8, you have the option to employ the novel collection expression to generate frequently used collection values. A collection
2/6/2024
16 : 14

General Performance Tip: Null Coalescing Assignment

Read on blog or Reader dotNetDave posted: " C# 8 introduced a novel method for performing null coalescing assignments, as illustrated below. DataTable table = null; var testTable = new DataTable()
2/5/2024
23 : 4

Exploring the Code World: dotNetDave Inquires About Guests’ Hobbies and Pastimes – Part 1

Read on blog or Reader dotNetDave posted: " At the conclusion of every episode of "Rockin' the Code World with dotNetDave," I make it a point to inquire about my first-time guests
2/5/2024
9 : 4

General Performance Tip: Optimizing Attributes

Read on blog or Reader dotNetDave posted: " When crafting custom attributes, Microsoft advises sealing them to enhance performance. In my coding standards manual, I advocate sealing any class not
1/30/2024
9 : 4

Collection Performance: Converting Byte Array to ReadOnlySpan<BYTe>

dotNetDave posted: " If you are dealing with byte arrays and require the conversion to ReadOnlySpan<byte>, there are two methods to achieve this, with one being more performant. Here is an
1/29/2024
9 : 14

Collection Performance in Microsoft .NET: Converting Byte Array to Memory<> and ReadOnlyMemory<>

dotNetDave posted: " If you are dealing with byte arrays and require the conversion to Memory<byte>, there are two methods to achieve this, with one being more performant. Here is an example
1/26/2024
9 : 4

Collection Performance in Microsoft .NET: Returning an Array from a Property

dotNetDave posted: " While reviewing code, I've noticed that many developers adopt a class design where properties return arrays, commonly seen with arrays of bytes. According to Microsoft
1/25/2024
9 : 4

Collection Performance in Microsoft .NET: Finding First or Last and Count

dotNetDave posted: " When you need to find the first or last item in a collection or obtain its count, many developers use the LINQ methods First(), Last(), or Count() as shown in this example:
1/23/2024
9 : 14

Collection Performance in Microsoft .NET: Converting Byte Array to Span<BYTe>

dotNetDave posted: " If you are dealing with byte arrays and require the conversion to Span<byte>, there are two methods to achieve this, with one being more performant. Here is an example:
1/23/2024
9 : 14

Rockin’ the Code World Season 4: Special Guest Jared Parsons

dotNetDave posted: " I hope you will join me on Saturday, February 3rd, 2024, at 10:00 PST on C# Corner TV for show #96! For the second time, my very special guest will be Jared Parsons, Principal
1/22/2024
9 : 14

String Performance Microsoft .NET: Retrieving a Substring

dotNetDave posted: " When you need to extract a portion of a string, many developers often utilize the string.Substring() method, as demonstrated in the following example: if(int.TryParse(