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

dotNetDave Says…Always Code For Reusability

You can overhear me say this in every one of my code conference sessions! I've been coding for over 25 years, and this way of thinking has allowed me to make changes to the code, later in time, easier. For example, in a recent project that I was hired to work on about 4 months … Continue reading dotNetDave Says…Always Code For Reusability

Announcing the Second Edition of Rock Your Code: Code & App Performance for Microsoft.NET

Today I am announcing the brand new edition of my book titled Rock Your Code: Code & App Performance for Microsoft .NET, now available on Amazon. How fast your code executes is very important for your users and back-end server processes. This is even more important for the future as more and more users, use … Continue reading Announcing the Second Edition of Rock Your Code: Code & App Performance for Microsoft.NET

Improve Your Model Classes with OOP – Part 2: Constructors, Interfaces & More

  In part 1 of this series, I discussed building model classes properly with Object-Oriented Programming (OOP), specifically encapsulation that must include data validation. In this article, I’m going to show you constructors, interfaces and more that you should implement for your model classes. We will build upon the Person.cs type from part 1 and … Continue reading Improve Your Model Classes with OOP – Part 2: Constructors, Interfaces & More

Improve Your Model Classes with OOP – Part 1: The Basics

Ever since I have been speaking and writing, I have talked about proper class design using Object-Oriented Programming. OOP has been around since the 1950s and to me is still the best way to properly design classes, for now, and the future. Many of the projects I see fail are due to not using OOP … Continue reading Improve Your Model Classes with OOP – Part 1: The Basics

Reuse, Reuse and More Code Reuse!

Recently an intern on the team I am currently working on asked me to review the code on a new solution he has been tasked to code. About a week or so later, I received the following from him via chat: On the project I sent you, I don't understand what you mean by use … Continue reading Reuse, Reuse and More Code Reuse!