Jay and Properties…

April 29, 2004 at 9:55 pm

Jay wrote a post entitled Properties? Not my bag, baby.

When I first started writing C# code, I used properties for everything. But recently, I’ve felt that I was wasting a lot of time writing trivial properties. Yes, I know that in Whidbey I’ll be able to use expansions to write them easily, but that still means that I have to deal with the property bodies cluttering up my code.

So, that got me thinking about whether it makes sense to be writing properties in the first place. After a bit of thought, here’s my current position:

Properties are a great thing for component libraries. There are certainly cases where you would want the future-proofing and decoupling that properties gives you.

But when you’re working on a single project that gets built all at once, I don’t think you’re getting any future-proofing benefits, and you have to pay the “property tax” the whole time.

This may be heretical, since “use properties” has been the common guideline.

What do you think?

Taking it to the next level…

April 15, 2004 at 9:21 pm

Josh writes:

I’ve been working professionally with C# for about 2 years now and am just blown away by the things I can do with it. Lately though, I’ve felt like I’ve plateaud at this beginner to intermediate level. Every book I look at is either “Hello, World” or beyond my level of expertise, I feel like I’m always one step behind the game and my code is becoming stale.

That’s a very interesting question. I’m not longer a professional programmer (though I was for a little over a decade), so you’ll also want to listen to the comments that others are sure to write.

If you haven’t read them, there are a couple of books that I’d definitely recommend.

Code Complete
The Pragmatic Programmer

Both of these are currently on my bookshelf (actually, they would be if somebody hadn’t walked off with my copy of Code Complete).

To expose yourself to some new ideas, I’d also suggest:

Refactoring: Improving the Design of Existing Code
Extreme Programming Adventures in C#
Test-Driven Development in Microsoft .NET

Whether you agree with these approaches or not, they are certainly thought-provoking.

The best programmers that I’ve known always have a few side projects going on, where they’re exploring new areas, new environments, etc. If you’ve never done network programming, try writing some socket code, or play around with remoting, or DirectX. Play around with tools, like a profiler, or measure the performance of different options. Get a book on .NET IL and spend some time under the covers (Richter’s book is a good guide here).

Finally – and this may seem like weird advice from a C# guy – spend some time writing some code in a language such as Perl. Scripting languages lead to a different mindset that can be useful in language.

Pragmatic Unit Testing in C# with NUnit

April 13, 2004 at 7:59 am

I got this reference from http://www.theserverside.net, but since they require login to get to the link, I’ll instead refer you to the book page

I took a look one of the sample chapters, and I thought it looked pretty good, except for the fact that the first interface in the chapter is named “Environment” (the others are fine). 

A new career choice

April 2, 2004 at 11:12 am

Let’s see:

  • Never been convicted of a felony

  • US born

  • 40 years or older

  • Resident for the last 40 years.

I can run for president!

Darn. I just checked Wikipedia, and found out that you only have to be 35. I’ve been wasting the last 5 years.