Approximately 90% of code reviews highlight the use of List in public APIs, a practice discouraged by Microsoft due to issues with encapsulation and flexibility. Alternatives like ReadOnlyCollection are recommended for better abstraction and performance. Proper usage can enhance compatibility and maintainability in codebases.
Category: .NET
Microsoft .NET Code Analysis: Ensuring Proper Resource Management – Implementing IDisposable for Disposable Objects
One persistent issue I have noticed throughout my experience working on projects for the past 12 years is the improper handling of disposable objects and the lack of implementation of IDisposable for types with disposable fields. Failing to handle these objects correctly can lead to virtual memory leaks and subsequently bring down applications and services. Unfortunately, this problem occurs far too frequently.
Real World Coding Issues: Part 2 – Style and Performance Issues
The author is nearing the end of a contract and wants to discuss coding issues they encountered during the development of a particular solution and other projects. Their goal is to provide valuable insights to improve the codebase of the current project. They reflect on the initial state of the codebase when they joined the team and how it has evolved during their tenure. The author's objective is to leave the code, project, and team in a better state than when they started. They were hired to enhance performance and code quality. The author also mentions that they have noticed common coding issues in multiple projects and this article aims to provide statistics and highlight these prevalent issues.
Microsoft .NET Code Analysis: Recognizing the Significance of ConfigureAwait in Reusable Assemblies
Check out this article on the importance of ConfigureAwait() in reusable assemblies. It discusses performance, avoiding deadlocks, and scalability.
Microsoft .NET Code Analysis: UTF-7 Encoding Is Insecure
In the codebase I reviewed for this article, I found several instances where UTF-7 encoding was used, which is no longer recommended and is prohibited by many specifications. It is important to avoid using UTF-7 encoding that is explained in this article.
Using Explicit Operators in Microsoft .NET to Perform Type Conversions
This article outlines the implementation of explicit conversion operators in .NET to manage type conversions effectively. By creating a public static explicit operator and a corresponding conversion method, developers can streamline conversion logic. A practical example illustrates converting a value-type Person to a reference-type Person, emphasizing benefits like type safety and cleaner code.
Microsoft .NET Code Analysis: Always Add Braces {} in C#
The discussion centers around the usage of braces in C# statements and their criticality in maintaining code readability and structure. Using braces helps delineate code blocks, groups statements, controls flow and scope and avoids unintended errors. The author promotes regular refactoring with tools like CodeRush and suggests integrating specific settings into the EditorConfig file. He also recommends his books for additional guidance and insights.
Rockin’ the Code World: Special Guest Safia Abdalla
Join me on Saturday, July 8th, 2023, at 10:00 PST on C# Corner TV for show #83 where, for the first time, my special guest will be Safia Abdalla, Senior Software Engineer on the ASP.NET team. Don't miss this episode!
Rockin’ the Code World: Special Guest Rocky Lhotka
Join me on Saturday, June 17th, 2023, at 10:00 PST on C# Corner TV for show #82 where, for the second time, my special guest will be my good, long-time friend Rocky Lhotka, VP of Strategy at Xpirit US. Don't miss this episode!
Real World Coding Issues: Part 1 – An Introduction
The author is nearing the end of a contract and wants to discuss coding issues they encountered during the development of a particular solution and other projects. Their goal is to provide valuable insights to improve the codebase of the current project. They reflect on the initial state of the codebase when they joined the team and how it has evolved during their tenure. The author's objective is to leave the code, project, and team in a better state than when they started. They were hired to enhance performance and code quality. The author also mentions that they have noticed common coding issues in multiple projects and this article aims to provide statistics and highlight these prevalent issues.

You must be logged in to post a comment.