Proper Type Encapsulation – Part 2

In part 1 of this article, I explained how to implement proper data encapsulation. In part 2 I want to talk about encapsulating business logic. I see this missing in a lot of type design, especially when using an ORM like Entity Framework. It’s the job of the architect and coder of that type to … Continue reading Proper Type Encapsulation – Part 2

Performance Tip: Checking For Empty String

In all my books and conference sessions I talk about the proper way to test if a string is valid. Microsoft .NET has been around almost two decades and I still see code like this: if (testValue.Trim() == "") This code is even wrong since it's not checking for null. A better way would be like this: … Continue reading Performance Tip: Checking For Empty String

Processing AWS SQS Messages via a LAMBDA

With the short time I have been programming using Amazon Web Services (AWS) I have learned three things... AWS is NOT .NET Framework friendly! They are more .NET Core friendly but don't keep up with the latest version. The AWS .NET SDK needs a lot of work. I've previously wrote about this in my "Is … Continue reading Processing AWS SQS Messages via a LAMBDA

Proper Type Encapsulation – Part 1

Encapsulation is the first pillar of Object Oriented Programming and maybe the most important. This is how wikipedia.org defines encapsulation: Encapsulation is one of the fundamentals of OOP (object-oriented programming). It refers to the bundling of data with the methods that operate on that data. Encapsulation is used to hide the values or state of … Continue reading Proper Type Encapsulation – Part 1

Is Quality Part of Open-Source Projects Your App Is Using?

Is code quality important to your team? It should be at the top of the list, not only to make your customers happy, but make your team happier when bugs arise and when features need to be added. Putting quality in your code in the future is a lot more expensive than doing it when … Continue reading Is Quality Part of Open-Source Projects Your App Is Using?

Defensive Programming – Let Type Checking Work for You

Since I have been a speaker and a teacher, I have always stressed the importance of practicing proper object-oriented programming (OOP) techniques. If you don’t practice OOP, no matter what language you are using, I guarantee you will end up with a “house of cards” and they all eventually fall. The first “pillar” of OOP … Continue reading Defensive Programming – Let Type Checking Work for You

Performance: SortedDictionary vs Dictionary

Recently when I was analyzing a clients code base for performance, I found that they were using the collection SortedDictionary in many places in their projects. After looking on how they are using this collection type, I discovered that they really only needed  the collection sorted once. So I figured, that if would be better … Continue reading Performance: SortedDictionary vs Dictionary