For my work moving Spargine to .NET 6, I have completely rewritten the Spargine methods to validate method parameters. In this release, these methods have been changed to allow fluent validation.
Category: Defensive Programming
dotNetDave Rocks the Philly Code Camp 2022
The dotNetDave For Those About to Code: Worldwide Tour will be at the Philly Code Camp in Philadelphia, PA on March 4th. I hope you will join me at this meeting.
dotNetDave Says… Fixing Bugs Is Like Playing the Game Whack-A-Mole!
Let’s face it, no software engineers like fixing bugs in code. Since no software is perfect, they are going to happen. They are a fact of life for software engineers. Sometimes, it feels like we are playing the game Whack-A-Mole where no matter how many we fix, more will pop up.
dotNetDave Says… No One Writes Perfect Code!
Lets face it, none of us write perfect code all the time! Especially since there are many ways to write the code to achieve its purpose. The best way to make sure the code is the best it can be is by asking someone to review it!
DotNetDave Says… All Data Coming into a Type Must Be Validated!
Do you use object-oriented programming? If so, do you validate data coming into your types? If not, then you have broken the first pillar of OOP which is encapsulation.
Serializing Objects Performance: XML Serialization
XML serialization has been around ever since .NET was released since it was so widely used back then. It’s still widely used, especially for legacy applications and services, even iTunes still uses XML to store library information. Benchmark results are for .NET 5 & 6.
Reference Type & Structure Performance: Expanded & Expression Bodied Methods
A newer way of creating simple methods in .NET is by using expression-bodied methods. This article shows which method is more performant.
Reference Type & Structure Performance: Normal vs Static Methods
Most of the code analysis tools, including tools from Microsoft, recommends creating static methods if possible, stating performance as one of the reasons. But are static methods more performant than normal non-static methods? This articles shows your which is more performant!
String Performance: Encoding and Decoding Strings
Encoding and decoding strings to and from a byte[] is used a lot in programming. Performance results are for using The formatting options are ASCII, Unicode, UTF8, and UTF32.
String Performance: Combining Strings with the StringBuilder
When concatenating many strings, especially in a loop, using the StringBuilder class is usually more performant and uses less memory.
You must be logged in to post a comment.