The article emphasizes the critical importance of addressing IDisposable issues in code assessments, highlighting common problems such as virtual memory leaks, unreleased file handles, and escalated database connections. The author provides solutions to two prevalent issues: neglecting to call Dispose() on disposable types and failing to implement the IDisposable interface. Additionally, the author introduces three extension methods from their open-source assembly, Spargine, designed to simplify the disposal of types and mitigate potential memory issues in large collections.
Category: Defensive Programming
Structure Performance: Implementing Operators
The post discusses the necessity of implementing equality operators (== and !=) for structures, as they do not have inherent implementations. Providing an example, it highlights the ease of this process using refactoring tools like CodeRush. The author recommends consistently implementing these operators and mentions configuring code analysis in EditorConfig.
Reference Type & Structure Performance: Override Object Virtual Methods
This content discusses optimizing performance for reference types and structures in .NET. It emphasizes the importance of understanding memory allocation and recommends overriding methods and operators in structures. The author stresses the need for careful benchmarking before making overrides.
General Performance Tip: Using Statements and Unused References
This article series provides crucial coding tips for improving performance, emphasizing the impact of small changes when handling high message volumes. It advises on removing unnecessary using statements to streamline code and improve type creation. The CodeRush refactoring tool or manual removal methods are recommended. Further details can be found in the "Analyzing Code for Issues" chapter of a code performance book.
Code Quality & Performance Virtual Conference – 2021
I'm so happy to announce I will be hosting the worlds first code quality and performance virtual conference that will be streamed by C# Corner Live on June 18th that starts at 10 am EST. I have been wanting to do a conference like this for over 10 years and I'm so excited to finally … Continue reading Code Quality & Performance Virtual Conference – 2021
Rock Your Code :Coding Standards for Microsoft .NET – 7th Edition
I'm excited to announce the 7th edition of my coding standards book for Microsoft .NET! This book is a compilation of common Microsoft .NET coding standards in use today. In the past, for languages like Visual Basic, Microsoft published coding standards in a single document that developers could follow or use as a basis to … Continue reading Rock Your Code :Coding Standards for Microsoft .NET – 7th Edition
dotNetDave Rocks The Austin .NET User Group
The dotNetDave No Apologies World Tour will be at the Austin .NET User Group in Texas on October 12th. I hope you will join me at this meeting. This meeting will be virtual, but I wish it was in person... I love visiting Austin! My session will be followed with a Q&A where you can … Continue reading dotNetDave Rocks The Austin .NET User Group
Coding Faster with the dotNetTips Utility: September 2020 Update
After the last quarterly release of my open-source projects and NuGet packages, I’ve added more methods for my projects, and ones for use where I work. I’ve decided to release a min-quarter version (2020.9.20.01) so my team at work can use them and so I can use them in the app that I’ve released for … Continue reading Coding Faster with the dotNetTips Utility: September 2020 Update
Encapsulation Done Right: Improving Class Property Design in Microsoft .NET
The article discusses encapsulation in Object-Oriented Programming, highlighting its importance in ensuring data integrity. It details how a developer improved class properties with proper validation and automatic updates between related properties, thus adhering to encapsulation principles. Key recommendations include using DateTime.TryParse and encapsulating business logic within property setters.
dotNetDave Approved: CodeRush for Visual Studio
After over 20 years, I've decided to start recognizing the third-party components and add-ins to Visual Studio that I use just about every day and swear by. The first is the only refactoring tool that I have used for Microsoft .NET called CodeRush for Visual Studio by Developer Express Inc. (DevExpress.com). I have tried others, … Continue reading dotNetDave Approved: CodeRush for Visual Studio

You must be logged in to post a comment.