This article discusses the proper way to check for empty strings in C#.
I am happy to announce the fourth release (v2021.9.4.23) of Spargine, my brand new open-source projects, and NuGet packages for .NET 5 and above. I have added new classes, methods, and unit tests!
Let’s discuss for() and foreach() under load to establish a baseline. As you can see below, I used the same code in the previous chapter and added Task.Delay() to simulate a CPU load.
Using List is perfectly fine when creating a collection when the number of items is not known beforehand. If the number of items is known, or even a close estimate, it could be more performant setting the collection capacity as shown in this article.
Back when .NET was first released in 2002, generally, there was only one way to code things. But now that we have the .NET Framework (Clr), .NET Core, and .NET, there can be many ways to code the same thing. The results in this article will focus on showing the different ways where there is very little difference in .NET 5.
The dotNetDave For Those About To Code: Worldwide Tour will be at the GLUGnet User Group in Okemos, MI on August 19th at 6 PM EDT. I hope you will join me at this meeting. This meeting will be virtual, but I wish it was in person. My session will be followed by a Q&A where you can ask me anything!
When architecting and wring code, performance and memory usage should always be something that needs to be addressed. Especially since so much is being moved to the cloud. Performance and memory usage done improperly can dramatically increase the cost of cloud services. If performance is slow, YOU WILL LOOSE CUSTOMERS!
I have stated many, many times, “Performance affects memory and memory affects performance”. None of the code analysis tools I've written about will find every issue when it comes to memory and performance issue. The only way to find the rest is by using a memory profiler tool on running code near to production machine setup as possible.
CodeIt.Right from Submain.com is a static code analysis add-in to Visual Studio. It follows the same rules as FxCop/ Analyze. The best part of CodeIt.Right is that it not only finds the same violations, but it will fix around 90% of them by just clicking a button!
Analyze has been available in most of the Visual Studio editions for a long time and is based on FxCop. This article will discuss how to set it up and use it properly.