Thursday, April 29, 2010

Introduction and something cool

Well since I have been added as a co-author for this blog, I suppose introductions, perhaps rant, and a cool link are in order.

Let us get the introductions out of the way for anyone who might care or what to look at my first post ever....meh that's bullshit. I doubt people care and you can always look at my profile anyway.

Time to begin a rant, well more of a story. I hate WebForms. Having to keep track of an event lifecycle to wrap up a bad abstraction for the web sucks. I completely understand where it came from, why it exists (silly event driven desktop apps), and that there are a lot of controls out there for reuse (paid and free). Recently this hate of it came up again as I had a chance to deal with some code at work.

I got a chance to do a major refactoring of part of our product at work. This part displays dynamic forms. It's all data driven and it pieced together the form with programmatically created controls. The problem was the original system seemed to have been voodoo coded until it work which left any programmer staring at the code wishing they were a psychopath with the address of the author.

I think the big problem here was that the original author didn't really understand the whole lifecycle thing (hell I barely got down...nah I doubt I do). Server side validation was broken because of how the controls were loaded (by the way make sure you create all those dynamic controls again before Page_Load and give them the same Ids), and they ended up fishing through all the post data manually to save stuff.

This misunderstanding bleed through it seems to a lot of areas involving this part of the system. When I got a chance to rework the whole thing everyone felt it came out much better from the code point of view and we now get consistent results along with proper validation. But we might be tracking down some bugs for a little while due to how they originally handled everything.

Really the solution to all this is, just slow down. Everything can't be on fire. You need time to get going, to understand, and you can't have blinders on when you're sprinting. Sometimes you need to stop and think if you're facing problems due to problem or problems due to your solution. I suppose time crunch is usually to blame but (although perhaps a bit extreme) I'll have to quote Lincoln:

"If you give me 6 hours to chop down a tree, I'll spend the first 4 sharpening my axe."

Ok, so I suppose now it's time for something cool.

Vim is awesome and check out this code kata in Python:

I hope that came out mostly comprehensible because my eyes were actually losing focusing during the writing of this post.

No comments:

Post a Comment