I'm excited to announce the 7th edition on my coding standards book for Microsoft .NET 5! 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 … Continue reading Rock Your Code :Coding Standards for Microsoft .NET – 7th Edition
Category: Coding Standards
OOP: Encapsulating Business Logic in Class Properties
The first “pillar” of Object-Oriented Programming (OOP) is encapsulation. If you have ever come to one of my conference sessions, you might hear me say… If encapsulation isn’t done correctly, I have little hope that the other pillars of OOP are being done properly or at all! For this article, I will be explaining how … Continue reading OOP: Encapsulating Business Logic in Class Properties
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
Unit Testing with Random Data
In 2019, while I was working on benchmark tests for my new book on code & app performance, I wanted to use “real-world” data types like a person or a coordinate along with methods for creating random words, email addresses, URLs, etc. After I worked on the code, I thought that most of it could … Continue reading Unit Testing with Random Data
New Book Release! Rock Your Code: Coding Standards for Microsoft .NET
Announcing the 6th edition of my coding standards book for Microsoft .NET! Newly updated for .NET Core 3.1 and .NET Framework 4.8. 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 … Continue reading New Book Release! Rock Your Code: Coding Standards for Microsoft .NET
What Can Be Done to Make Code Quality Better?
Since 2014, all my conference sessions have been wrapped around code quality. It has always been very important to me and I try to include a lot of that concept in my coding standards book. Since that time, I have asked developers to participate in an online survey to see how they implement coding standards … Continue reading What Can Be Done to Make Code Quality Better?
Properly Setting Up .NET Core Projects
Visual Studio by default does not set all the appropriate options to help you write rock-solid .NET Core code. Below are the recommendations that your team should use for C# projects. All the following recommendations are for Visual Studio 2019. If you have an older version, most of this should still apply. To learn the … Continue reading Properly Setting Up .NET Core Projects
Properly Setting Up .NET Framework Projects
Visual Studio by default does not set all the appropriate options to help you write rock-solid code. I will show the recommendations that your team should use for C# projects. All the following recommendations are for Visual Studio 2019. If you have an older version, most of this should still apply. More information, including suggestions … Continue reading Properly Setting Up .NET Framework Projects
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
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