Properly Comparing Strings with Globalization and Performance in .NET

In Microsoft .NET there are many ways to compare strings. I would say that most of the code I analyze, I see it done one of these two ways: bool result = email1 == email2; bool result = email1.Equals(email2); Is this the best way to compare strings? The quick answer is no. While this works, … Continue reading Properly Comparing Strings with Globalization and Performance in .NET

Using the New IAsyncEnumerable Interface in .NET Core 3

The release of .NET Core 3 last month includes a brand new IAsyncEnumerable interface in the System.Collections.Generic namespace. The Microsoft documentation simply states: Exposes an enumerator that provides asynchronous iteration over values of a specified type.Microsoft Documentation This new interface sounds interesting, so I looked at the code in my open-source assembly to see if … Continue reading Using the New IAsyncEnumerable Interface in .NET Core 3

dotNetDave Rocks the Granite State Code Camp

For the first time, the dotNetDave 25th Anniversary World Tour is coming to the Granite State Code Camp in Manchester, NH on November 2nd! Even though I was born back east (Delaware), I don't think I have ever been to the state. If you live in the area, please let me know what I should … Continue reading dotNetDave Rocks the Granite State Code Camp

dotNetDave Says… If Your Code Is Hard To Unit Test, You’re Doing It Wrong

Unit testing is something very important for any project. With that said, I rarely see it done in projects or done correctly. How can you push the code to quality assurance or production without knowing the state of the code? A few years back, I worked on a contract at a company here in San … Continue reading dotNetDave Says… If Your Code Is Hard To Unit Test, You’re Doing It Wrong

Announcing the Second Edition of Rock Your Code: Code & App Performance for Microsoft.NET

Today I am announcing the brand new edition of my book titled Rock Your Code: Code & App Performance for Microsoft .NET, now available on Amazon. How fast your code executes is very important for your users and back-end server processes. This is even more important for the future as more and more users, use … Continue reading Announcing the Second Edition of Rock Your Code: Code & App Performance for Microsoft.NET

Improve Your Model Classes with OOP – Part 3: Serialization

In part 1 of this series, I discussed building model classes properly with Object-Oriented Programming (OOP), specifically encapsulation that must always include data validation. In part 2 I  showed you constructors, interfaces and more that you should implement in your model classes. In this article, we will build upon the Person.cs type from part 2 … Continue reading Improve Your Model Classes with OOP – Part 3: Serialization