Thursday, February 21, 2008

How an AJAX guy would pack

At the request of (soon to be former) boss, Brian H. Prince, I've been tasked with explaining how an AJAX guy would pack. Even though this AJAX guy isn't involved in the moving because he's been off site for almost a year, I'll play along...

The first problem an AJAX guy is faced with when preparing to pack are the vast array of box options available to him. All the boxes appear to be roughly the same size, they are just slightly different colors of brown. There is one box that appears to be bigger, so it will hold more for the big move, but upon opening the box you see that a lot of space inside is taken up by an inner, un-openable box with "Update Panel" stamped on it. So, in the end, all the boxes hold roughly the same amount of stuff.

So, after picking a box, AJAX Packing Guy (or Gal) - henceforth referred to as APG - gets down to improving the packing user experience. APG opens up three boxes, puts one item in each box, then goes about cleaning their desk. At some point during the desk cleaning they notice that all three boxes are now full. They seal those up, and open three more boxes, then back to cleaning the desk. Oh, look at that...those three are now full, too!

Once all the items are packed away, APG uses their powers to make each box shrink and fade at the same time...only to reverse the process at the new site and have the packed boxes reappear by fading back in and growing back to normal size.

What happened to the APG who picked the larger box, you wonder? Well, the "Update Panel" carton inside looked to be very helpful at first, but once APG opened more than once box and set them to working, the update panels started running into each other, and reopening packed boxes, and taking apart boxes that had been put together. Eventually they got everything packed, and APG had to do very little in the way of opening boxes, but it took a while.

Thursday, February 21, 2008

Does Your Project Have a Junk Drawer

Everybody's kitchen has a junk drawer. You know, the drawer where the tape, scissors, small jar of screws, various measuring items, and those clacker balls on a string that your mom is hiding from you. (Well, the ones my mom was hiding from me.) If you've got something in the house, and you're not sure where it goes, you fire it into the junk drawer. Oddly enough, you also find many useful items by looking in the junk drawer first when tackling something around the house.

However, I've found on a few recent projects that we're falling into the Junk Drawer model a bit. Look around your project, do you have file named "Utilities?" Maybe one called "GlobalMethods?" Or the very popular "ProjectHelper?" If so, there's a good chance you're throwing all kinds of things into the junk drawer. Could be a static class library, a little something in the App_Code directory in an ASP.Net project, or even a javascript file. Or, better yet, all three!

Now, don't misunderstand me, utility classes can be helpful. If you've got a series of string manipulations you need for a project, then a static stringUtils file makes perfect sense. Maybe a constants file for things that don't fit in an enum. As long as they are well defined and don't creep outside the scope of what you're trying to accomplish, I think they can be very helpful.

But, the junk drawer file that contains string manipulations, constants, get user name methods, some validation methods, a few odd conversion methods, a couple more string methods, and a few methods only called from your test project is not much of an asset to your project.

From a usage aspect, how do you tell other team members where your constants live? If they're scattered about your utility file, suddenly you're going to the same file for some string methods and your constants representing a product group. Or worse, your team gets so used to hitting your helper file that everything starts collecting there. Before you know it, you're looking at a maintenance nightmare with a couple thousand lines of code that should live in a number of more logical places.

Look around your projects, if you find a junk drawer take the time to refactor that thing out of there. Get all the files where they belong. You could end up with a utility file or two, but most likely you'll find you can move a number of methods right to the class that's using them because it's the only class that's using them. Turns out our friend YAGNI contributes many "global utility" functions to our projects.

Keep the junk drawer in your kitchen, though. Where else are you going to keep your SpongeBob commemorative Krusty Krab stamp?

Friday, January 11, 2008

CodeMash: Feeling The Vibe.

I had originally set out to cover my travels through CodeMash similar to my post from Day 1. Give a recap of my morning, afternoon, etc. However, it soon became clear that keeping up with what I was hearing and doing was going to be tough, and that I wasn't going to have the time to sit down and enter it. On top of that, it feels like giving a couple sentences to somebody's 1:15 presentation gives them a disservice for the work they put into it.

Then I read Scott Hanselman's entry on his day at CodeMash, and I couldn't agree more with his point about "The Vibe" of the conference. Scott made a great contribution to The Vibe with his great keynote followed by just wandering the halls and jumping into conversations. A few of us were lucky enough to have him jump into our conversation before he discovered Rock Band. What's odd is it was kind of the "CodeMash Way" to have Scott drop in and say, "So, what are you guys talking about?" It just seemed normal, and the conversation didn't miss a beat.

The "CodeMash Way" is that everybody wants to learn something from everybody else. Nobody's language or approach is any better or worse than the person you're talking with, both of you are trying to learn something from the other. It's at its most evident when you look around the room during a presentation. Josh Holmes was giving a talk on Microsoft's DLR, and in the back of the room Joe O'Brien is taking it all in...and helping Josh along with some of the dynamic language benefits. The flip side is Josh was in the back of the room for Joe's talk on testing in Ruby the day before. The aforementioned Scott Hanselman was sitting along the wall for Dustin Campbell's presentation on F#. (And Scott's phone rang twice...that's two rounds of donuts, Mr. Hanselman.)

Suddenly the community isn't defined as the Ruby community, the .Net community, or the Java community...we're one big problem solving community exploring what weapons we can add to the arsenal to solve those problems. What .Net or Java guy heard Joe say, "I have 100% code coverage in Ruby at all times," and didn't have their jaw hit the floor? (Probably more than one since he asked the room what their coverage was and got answers ranging from "code coverage?" to 25% to 80%.)

I added a little to The Vibe, giving some advice on ASP.Net AJAX in the hallway (and thinking next year I should offer up a talk titled, "The Update Panel Sucks"), but for the most part I just soaked up all I could soak up. I went to Ruby discussions, saw plenty of Java code, and my only .Net sessions were on F# (where I was lost about 8 minutes after, "Hi, I'm Dustin Campbell" - functional programming not my bag) and Josh Holmes's talk on the DLR.

The best place to dig The Vibe is in the hallways, the open spaces, and the "Ask the Experts" sessions. I got the chance to meet and talk to Sara Ford in the hallway, but only because Jim Weirich had stolen the experts room to give his 10 things about Ruby talk, which I was attending.

The amount of Ruby I learned in there pales in comparison to the informal sessions many of us had with Jim. I really lucked out here. It started with CodeMash committee member and speaker, aspiring member of the Blue Man Group, Rock Band star, agile aficionado, and all around great guy Brian Prince walking up to Jim at the QSI sponsored Meet and Greet and asking what Aaron and I needed to do to get started in Ruby. That started an hour long discussion that many people walked up and joined. The next day at lunch, a few of us were sitting at a table eating when Jim walked by and recognized us from the night before, so he joined us. More opportunity to soak up what he had to offer. (I later commented to Brian, "Jim walks by and you learn something.") This isn't meant to be the Jim Weirich love-fest, he's a nice guy and all, but more along the lines of the "accidental" things that happen at CodeMash to add to The Vibe.

Compared to last year, I think The Vibe took on a much bigger feel this year. Maybe that's me moving out of my comfort zone at sessions, but mostly I noticed it outside the sessions while walking around. The informality of CodeMash builds The Vibe, but the people attending and speaking dropping our "barriers" is what takes The Vibe to a fever pitch. I'm already looking forward to next year's edition.

Of Note: I didn't win an iPod this year, like last year. I didn't win an Xbox or Wii, either. I did win a book...ON RUBY!!! Woo-Hoo!!

Thursday, January 10, 2008

CodeMash Day 1 Morning

CodeMash has started out with a bang for me, as I missed the first half of Neal Ford's Keynote on Software Engineering and Polygot Programming because I thought it started at 9 rather than the actual starting time of 8. The best part was I didn't oversleep, I was up in plenty of time, just didn't put my reading comprehension skills to work to read the start time of the keynote.

So, the last half of Neal's talk was excellent. (Referencing ORMs as programming's "Vietnam" was fun to witness.)

Following the keynote, I headed off to Testing Mandatory, a session given by Joe O'Brien about testing in Ruby. Solid session, and makes me want to learn Ruby that much more. Joe kind of shoots from the hip, but the message gets through. The biggest message was how easy testing is in Ruby, that it's built in from the beginning. He also provided a good idea on how to learn Ruby: Take one of the libraries and write unit tests for it.

The last morning session I headed to Intro to Castle with Jay Wren. Jay's pretty accomplished in Castle, so knows the material well. However, from my headbanging with Castle during my current project with trying to wedge it in our existing code base gave me all the intro that Jay was laying out. He did go more into MonoRail, so that was good, but I'm guessing my first trip into MVC land on ASP.Net will be with Microsoft's release of the same.

Tuesday, January 1, 2008

A Little CodeMash Love

Coming up in a few days will be CodeMash at the Kalahari Resort in Sandusky, OH. Having been to a few conferences, I consider this one a "don't miss." And here's why...

  1. It's an indoor waterpark...nerds in speedos!

  2. The collection of speakers and topics is second to none. This isn't your, "JAVA OR DIE!!!" meeting, just as its not, "Bill Gates cured my brother-in-law's limp," type show, either. It's a gathering of people passionate about their chosen field, wanting to share that passion, and get information on areas outside their comfort zone.

  3. The Kalahari sells alcohol. Consider the alcohol induced war stories: "I had to deal with a five part composite primary key that allowed nulls!" It can only get better from there...

  4. Keynoters that include Neal Ford (who also gave a keynote last year), Scott Hanselman, and Brian Goetz.

  5. Breakout sessions with Neal Ford, Brian Goetz, Bruce Eckel, and Brian Prince! (Yes, I know, "one of these things is not like the others," but he has a direct impact on my paycheck.)

  6. Conference food!!

If one or more of those six items hasn't piqued your interest then how about adding them all up: Brian Prince in a speedo delivering a presentation on Agile Development with a beer in one hand and a ham or turkey sandwich in the other.

Now that your interest has waned, fear not that won't happen. (And that direct impact on my paycheck is likely negative, now...)

Seriously, this is a good conference. If your looking for a "bang for your buck" type deal, then it's tough to beat CodeMash. I've been to pricier conferences and gotten much less out of them, mainly because much less was available. Last year's highlights for me were two breakout sessions with Scott Guthrie following his keynote and a session with Neal Ford on how to be a better overall developer. (Additionally, I had a strange urge to attend Burning Man...)

I came away last year being a little upset with myself for focusing too much in my .Net comfort zone, something I'm going to avoid this year. There are a couple of .Net sessions I want to see to learn some of the newer features, and one on Castle that I want to see. Beyond my comfort zone, there are a few Python sessions that I think I'll check-out. Oh, and I'll be in attendance at anything being presented by Neal Ford.

If you're planning on attending, look me up and say hi. I have a nullable composite key story to share with you. And, I don't own a speedo.