Showing posts with label external wisdom. Show all posts
Showing posts with label external wisdom. Show all posts

2008-04-14

"Why Properties Matter"

A colleague recently presented me with code that used a public field. I basically told him not to do that, but when he asked why not, I was unable to quickly formulate a convincing answer, and mumbled something along the lines of "changing a field to a property if you need to later is a breaking change". This was one of those trivial properties in a class that wasn't a component — pretty harmless using a field, right?

Jon Skeet has formulated the case against in a quite definitive way, and these were the objections I was thinking about that I couldn't immediately present my colleague with. Read C# in Depth: Why Properties Matter and you'll be able to convincingly tell people why properties are a better idea than fields.

2008-04-08

Event logging in .NET

I've been busy writing up a rather marvelous entry explaining how event logging works in .NET compared to the managed world. As these things go, by chance I was alerted to an MSDN Magazine article that describes just about everything I wanted to write about — in particular the way .NET gets around the limitations of message files and the pros and cons of that. Oh well, better luck next time...

It's listed under "Security Briefs", which seems to be quite a stretch (if event logging can go under there, just about everything can) but it's still a good article. Check it out at http://msdn2.microsoft.com/magazine/cc163446.