Lessons Learned

Preserved for Posterity
posts - 8, comments - 29, trackbacks - 0

My Links

News

Stack Overflow It's the reason my blog posts have trickled off. Blame it!

Archives

Post Categories

Links and Stuff

Monday, October 27, 2008

Windows Azure

So, by now you've probably heard of the Windows Azure news coming out of PDC; it's rather hard to avoid the media blitz.

It looks useful. Being able to easily deploy and scale services would be a big help, frankly -- if I could ever convince the Kool-aid drinking anti-PC Penguinistas that control our network to agree to such a system. Snowball's chance.

But I've a much more pressing issue to blog about than that. All I can think of since I heard the name is "Why???!?!? Who came up with such an aztacular name?"

UPDATE: Ok, now I'm confused. As I get deeper into Azure, it appears to only be available as a remote service from Microsoft. Is that correct? Or can enterprises purchase Azure and set up their own clouds? Further updates as I learn more.

posted @ Monday, October 27, 2008 4:40 PM | Feedback (2) | Filed Under [ Miscellanea ]

Friday, September 26, 2008

Are You a PC?

So it turns out I'm a PC. Are you?

I've been having trouble getting into this whole I'm a PC thing. I am a PC.

But I'm also a Mac and a Penguin.

posted @ Friday, September 26, 2008 9:21 AM | Feedback (2) | Filed Under [ Miscellanea ]

Monday, September 08, 2008

The Name of the Wind Fantasy Cast

If you are looking for a new fantasy novel / series, look no further than The Name of the Wind by Patrick Rothfuss. I won't bother you with a complete review; that's not the purpose of this post. But I will tell you that it's a well crafted novel and well worth the read. If you haven't read the book, this post will make little sense to you, so go buy the book and read it before you read this post. Don't worry, I'll wait for you.

Welcome back! As I said, the purpose of this post is not to provide a review of the book, but to do what every fanboy must do for a new favorite novel: list a Fantasy Cast. And so without further ado, here's my incomplete fantasy actor list in order of as I thought of it:

Kvothe
Rupert Grint -- I honestly picture him when I try to picture Kvothe. He'd have to be less goofy in the movie than in his other major roles as Ron, Ron, Ron, Ron, Ron, Ron, Ron and Ron. Ok, so he's done some other stuff too, but you have to admit he's kinda stuck in the role. This would be his breakaway chance. I think Rupert is up to the task.

Denna
Anne Hathaway -- Nobody charms as well as Anne.

Master Kilvin
Patrick Rothfuss -- I mean, come on, it's obvious, isn't it?

Simmon
Daniel Radcliffe -- He and Rupert just go together after 8 movies together, except now it's time for Harry to be the sidekick. Yes, I wrote 8. It turns out that Deathly Hallows will be split into two movies. Hadn't you heard?

Chronicler
Joss Whedon -- The absolutely perfect cameo. I dunno if I'd have him direct, though. If Joss directed, Kvothe would end up killed off halfway through the movie. I dunno how he'd do it, but you know that if anyone can pull it off such that one man is telling the story of his own death to another person while still being very much alive, it'd be Joss Whedon.

Bast
Nathan Fillion -- Another great cameo. He and Joss just go hand-in-hand in a totally not gay but that'd still be ok way.

Auri
Felicia Day -- Another great Whedonesque cameo. Plus, she can totally pull off sweet insane Auri.

Master Hemme
Christopher Lee -- He's just so good at being the bad guy!

Arcanist Abenthy
Ian Holm -- Others would probably put Ian McKellan into this role; why not Gandalf to play the stereotypical mentor? But I think Ian Holm fits the role better. He's just got a talent for that distracted but shrewd feel I get from Abenthy.

Ambrose
Niel Patrick Harris -- Straight from his role as the villian?-ish? Dr. Horrible, Neil Patrick Harris would add a certain j'ne sais quois to the character.

posted @ Monday, September 08, 2008 8:36 AM | Feedback (7) | Filed Under [ Miscellanea ]

Thursday, August 28, 2008

Don't Use NOLOCK, Use HOLDLOCK

Normally I very much agree with the things Jeff Atwood has to say. In the case of this post, however, I must take issue. What begins with a decent intro into the concept of deadlocks eventually ends with Jeff deciding to use the NOLOCK table hint to allow dirty reads of a table that had been locked by an update statement. He concludes with a complaint that Microsoft seems to think that Stack Overflow is a banking institution and therefore worthy of data integrity instead of the mere programmers blog/wiki/link exchange that it really is.

Jeff wildly misses the mark with his conclusion, in my opinion.

Not only is NOLOCK deprecated, Jeff seems to believe that data integrity is something one can safely do without "in certain scenarios". He is wrong. Every database not only deserves but requires data integrity.

Of the dozens of posts that replied to Jeff's article, a few diagnosed the real issue (long updating transactions) but only one (at least as of the time of this post) supplied the correct solution (in my opinion) to Jeff's problem. The poster's name was Filip and his blog is worth adding to your feed reader. The solution Filip pointed out is simple: Lock all your resources *before* you update them and put a waiting lock on them (HOLDLOCK) so that queries that want to use the resource wait until the update is done rather than dying petulantly.

UPDATE:

Sam Saffron (also another great addition to your feed reader) has posted an excellent rebuttal of Jeff's post explaining how and why deadlocks occur when selecting against an update and how to deal with them. Read it and remember it.

posted @ Thursday, August 28, 2008 9:36 AM | Feedback (2) |

Thursday, August 21, 2008

Hidden Surprises in .NET 3.5 Service Pack 1

Ok, imagine the following situation:

You are a developer and you want to keep up with the latest technology, so you update Visual Studio 2008 with Service Pack 1, installing .NET 3.5 Service Pack 1 as part of the update. You then proceed to continue with your ASP.NET application, building a nice neat AJAXy application. Everything works fine on your box, it's awesome, the in-your-cube demos go great, everybody's happy. So you build and deploy your new hotness then sit back and wait for the pats on the back.

The pats never come. Instead, you get reports of exceptions being thrown by the application every request. Something has gone horribly wrong. It's always the same exception:
Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 
'System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'.
You are stymied. You've never heard of the class; you certainly don't use it in your code. You use ScriptReference, of course; who doesn't? But what's ScriptReferenceBase? Going to the documentation for ScriptReferenceBase, you learn that it is the parent class of ScriptReference and CompositeScriptReference. What? No it isn't! The documentation for ScriptReference clearly indicates that it's parent is System.Object! What's going on here?

Then you notice the Version Information for ScriptReferenceBase: "Supported in: 3.5 SP1". It's a new class for Service Pack 1. It doesn't exist in .NET 3.5 and the documentation for ScriptReference is clearly stale.

Following a hunch, you double-check your server... yep. Due to red tape, SP1 hasn't been installed on the server. It turns out that when you compiled your code with the SP1 ScriptReference, you built a reference to ScriptReferenceBase and that class just isn't on the server. The solution is simple: install SP1 on the server.

Except you can't upgrade to SP1! Internal circumstances (i.e. no time for regression testing) means no upgrade. So no biggie; you return to Visual Studio 2008 and decide to target .NET 3.5 rather than .NET 3.5 SP1.

Except, surprise! You can't. Visual Studio will target .NET 3.0 and 2.0, but it won't let you differentiate between .NET 3.5 and .NET 3.5 SP1. OUCH.

So what do you do? At this point, your options are limited. The best option is to install SP1 on the server, but sometimes internal pressures won't allow that. Other options include uninstalling SP1 from your box and recompiling -- good luck with that one! -- and finding an unadulterated version of VS 2008 somewhere (a co-worker's box, maybe a virtual machine) and compiling there.

So why am I writing about this hypothetical situation? Because it happened to me, of course! I learned an important lesson. Maybe you can too.

posted @ Thursday, August 21, 2008 10:15 AM | Feedback (14) |

Monday, July 28, 2008

Whose Fault Are Poor Requirements?

I had thought I would do my first Lesson Learned about my control for the upcoming Silverlight Contest, but recent events changed my mind.

A phrase has been bandied about alot at work lately, a phrase we've all heard and uttered in one form or another at least once in our software careers. It exists in numerous variations, but essentially boils down to this:

"The software is bad because the requirements were bad."

I've seen it happen far too often: somebody complains that "<x> is broken" and the original developer goes on the defensive, blaming the customer for handing him faulty requirements. "It's not my fault! The customer asked for a button that rebooted the server! All I did was give them exactly what they wanted!"

I wholeheartedly disagree with this line of thinking. Claiming bad requirements is a copout.

We as developers have a responsibiltiy to find out why every feature is requested. We must get beyond that "I press a button and it does exactly what I'm thinking" requirement to the heart of the request. If you are handed a requirements document that doesn't make sense push back. Seek clarification. Learn more about the problem domain. Call the architect and tell him he's crazy, that it'll never work. And when you finally understand what the real requirement is, write it down. Save it for posterity. Communicate it with all parties. Find common ground. It can be done.

"But my boss told me to do it that way or I'd be fired!" you might say. Very true, but that's bad management, not bad requirements. That's a different copout.

posted @ Monday, July 28, 2008 10:33 PM | Feedback (0) |

Thursday, July 24, 2008

Silverlight Contest

In case you haven't heard, there's a programming contest going on. It's the Silverlight Control Builder Contest and you've still got time to play for fabulous prizes and the awe of your fellow geeks!

I'm gonna enter. Are you? Wait, you haven't had the chance to mess around with Silverlight? Neither have I!

Won't it be fun?

posted @ Thursday, July 24, 2008 10:41 PM | Feedback (0) |

So What's This Then?

And here it is. Another blog. Seems like everyone has one these days. Except me.

...Until now.

So yeah, I've finally decided to enter the blogosphere, whatever that is. It's not like there's anything roundish about the folks who write blogs.

Except maybe near the belly.

Ahem. Where was I? Oh, yes, blogging. So yeah, I'm blogging now. Mostly this blog will involve me posting about my pain developing software and the salves I used to soothe it. It will mostly be C# oriented, 'cause that's where I spend most of my time these days, although I may spend almost as much talking about software architecture and unit tests.

I may throw in the occasional item of interest to me so be prepared for that, too, dear reader.

Whomever you are.

posted @ Thursday, July 24, 2008 4:57 PM | Feedback (2) |

Powered by: