Castle now accepting donations (and getting one from me)

Castle Project is a wonderful thing. I still don’t understand a lot of it, but it’s darn impressive, and has become my library of choice. It’s also no coincidence that my long-sought departure from ASP.Net WebForms was timed with my discovery of Castle MonoRail.

Hammett (the man behind Castle) has finally started accepting donations for his work. I have one thing to say to him:

"It’s about time!"

I know first-hand what it’s like to spend a lot of time on something that:

  1. a lot of people use, and
  2. does not bring in any money (at least, not directly)

My pain has been CSFBL, which today does accept donations (and I truly appreciate every one of them!).

Thinking about this more, it’s been six months since I’ve donated to an open source/free project (I promised last year to donate $5 per month to one), so in order to catch up, I’m sending Hammett $30 ($5 per month). Let’s hope the exchange rate is favorable to him!

My open source donation history to date far is as follows.

Thanks for all your hard work, Hammett, and I hope you can afford yourself a nice vacation for the donations you receive!

Bad programming examples (part 1 of x)

There’s no end to the number of bad programming examples we’ve seen in the past or will see in the future. Recently, I saw this one. (This was actual code seen in an actual project.)

try { createDate = Request.Params["createDate"]; }
catch (Exception) { createDate = "-1"; }

Nice and ugly. Aside from a horrible way to implement a try/catch block, it screams of performance issues and unreadable code.

A more proper alternative follows.

createDate = Request.Params["createDate"] ?? "-1";

The same project also had this use of integer parsing.

try { myInt = Int32.Parse(textBox.Text); }
catch (Exception) { myInt = -1; }

In this case, you would use the TryParse method instead:

if (Int32.TryParse(textBox.Text, out myInt))
    myInt = -1;

Exception handling is for exceptions, not for null checking or validations.

Cancel (and renew) WebEx MeetMeNow to save $10 per month

I recently tried WebEx‘s MeetMeNow service (14-day trial). When the trial expired, I figured I’d cancel it — not because it wasn’t good (it was) or because it was too expensive (only $49/mo), but because I wasn’t sure if I’d need it in the next 30 days, and figured I could just renew the subscription right before the next time I’d need it.

I clicked the Cancel link, and was given a special 20% offer to change my mind. OK, I changed my mind again — deciding to keep the service at the $39/mo price.

The tip here? If you want to save $10/mo using MeetMeNow, sign up for the free trial, then cancel, then accept the service at $39/mo. Can’t argue with the marketing — it snookered me in. 🙂