My Initial Postsharp Setup — Logging at Assembly Granularity

PostSharp and Log4Net I tweeted a bit about this, and now I’m going to post about my initial experience with it. This comes from the perspective of someone new at this particular setup but familiar with the concepts in general. So, what are PostSharp and log4net? First up, log4net. This Continue reading

Why Are Public Fields No Good, Again?

Today, a developer on my team, relatively new to C# and some of the finer points of OO, asked me to take a look at his code. I saw this:

How would you react to this in my shoes? I bet like I did–with a quick “ooh, no good…try Continue reading

Exception Handling Basics

The other day, I was reviewing some code, and I saw a series of methods conforming to the following (anti) ‘pattern’ public class CustomerProcessor { public void ProcessCustomer(Customer customer) { try { if (customer.IsActive) ProcessActiveCustomer(customer); } catch (Exception ex) { throw ex; } } private void ProcessActiveCustomer(Customer customer) { try Continue reading