Sunday, May 11, 2008

Making The Switch

I've been curious about Linux for years. I've dipped my toe in the water in the past (installed Ubuntu on my home PC (that I never really use) a year or so ago until I flipped it to a Media Center PC), but I've never gone whole hog. I've never taken a primary machine and removed Windows. I've talked about it, I've pondered it, but I've never taken the leap.

Well, I'm about to leap.

The last week or two I've been evaluating the logistics of moving my work PC to Ubuntu. With the new Wubi installation option, I've been able to flip back and forth without needing to deal with the whole partitioning/dual-boot mess that I hate. I've managed to prove out most of my usage scenarios, and despite some frustrations and a bit of the 'sheen' coming off, I think I'm going to dive in. I'm about 99% certain that I can wipe my drive and throw Ubuntu on and still do everything I need to do, with virtual machines being my main fall back scenario where things just don't work.

I'm currently un-DRMing my purchased iTunes content, after which I should be ready to go. I don't know if I'll do it tonight, but likely sometime this week. I'll post my issues as I uncover them, but going in here are the things I'm a little disappointed about:

  • Evolution: It's the Outlook replacement, and I'm not super impressed. Seems pretty slow, I had some crashes while it downloaded my emails from exchange, and it's not real pretty. I might see if I can get connected via IMAP using Thunderbird, but I'll give Evolution more of a chance.
  • Networking: The NetworkManager app seems a little quirky, and I've had to mess with settings to get first connected wirelessly, and then again when I wanted to VPN to my office network. Even worse though, once VPN'd I can mount a windows share from work, but the file list I see is incomplete. I'm hoping I can figure this issue out, as I don't want to have to use a virtual machine to browse Windows network shares. This one almost sunk my move plans, but I've decided that there _must_ be a fix and that I'm not letting it stop me. If I can't resolve it after a few weeks, this might cause me to go back to XP. We'll see.
  • iTunes: No Linux version, and it doesn't seem like it works using Wine (at least for connecting to the iTunes store and/or actually sync-ing to my iPod). This isn't 'mission critical', so I haven't exhausted my research, so I might find a workable solution. I might try creating a VMWare Virtual Appliance thing specifically for iTunes too, see what that's all about.
  • Installing Apps: The Package Manager thing is pretty wicked, but installing apps that aren't in repositories is pretty painful. Linux needs to get that issue resolved if they ever hope to convert anyone aside from nerds.

Everything else seems pretty positive. I'm looking forward to becoming familiar with the OS as I use it on a daily basis. The speed seems pretty nice, and it's also fun to just be outside of my familiar Windows world, get out of the comfort zone and force myself to grow.

Wish me luck!

Wednesday, May 7, 2008

[Fact] vs [Test]

I got into a great discussion with Jeremy this morning on xUnit's use of the attribute [Fact] instead of a more common term like [Test]. I cringed the moment I saw [Fact]; it just felt wrong. And the more I read about the author's justifications for it, the more I cringe.

In most unit test frameworks, the word Test is used to describe or annotate the methods you write to prove your behaviour. For example, MSTest uses the [TestMethod] attribute, while NUnit and MbUnit simply use [Test]. xUnit has decided to go against convention and use [Fact]. Their reasoning seems to stem from an earlier decision they had made, which was to use [Theory] to annotate what are essentially data-driven tests, or more appropriately tests that are run against a set of inputs (think 'for-each thing in this set, do this test').

Here is what James Newkirk had to say in explaining [Fact]:
...someone in the audience said that if you were going to call "for-all" tests "Theory" then you should call a single test "Fact". Since then I have had a number of conversations with people and Fact seems to fit.

That explanation didn't exactly blow me away, so here is another one, this time from James' partner Brad Wilson:
The primary motivation is that it changes the expectations that what you do with this framework is capital-T Testing (aka, quality assurance). In reality, Test Driven Development is not really about testing at all. It's an example-driven design methodology which uses code to express the intentions of the class that is under design. The fact that it increases quality is a secondary benefit, and should not be considered a replacement for the work done by capital-T Testers. In Brian Marick's four quadrants of exploration through example, TDD-style code really only represents one of those quadrants (the technology-facing programmer support quadrant).

Additionally, as a word, [Fact] has very good symmetry with [Theory]. The two kinds of tests are fundamentally different; a [Fact] is an invariant statement which is always true, and a [Theory] is a statement which is true for all the given input values.

Now here is where my feathers start to ruffle. Brad writes about the xUnit framwork that "it's an example-driven design methodology which uses code to express the intentions of the class that is under design." Say what? Isn't that a fancy description of a unit test framework? Reading that is like going into a restaurant and having the waiter describe the ravioli as "a splendid blend of finely aged cheeses, high-quality bovine, and succulent savoy spinach, hand-sealed between two layers of circular pasta dough before being boiled in freshly salted mineral waters".

The argument that TDD is not really about testing at all does not fly with me. Of course it is about testing. Are there ways of doing TDD that provide more benefits than others? Sure, but they ALL provide the benefit of added quality (unless you are writing completely useless tests I suppose).

The entire usage of "capital-T Testing" irks me. Capital-T Testing is not the only kind of testing in a project, nor should it be. Look at it this way: we have a development environment, a QA environment, and a production environment. They are all still environments. Similarly we have developer testing and quality assurance testing. They are both forms of testing, and I've never heard anyone argue that developer (or unit testing, which is just a more structured and accurate approach than old-school test harnesses) should take the place of quality assurance testing.

Next, Brad almost spells out the exact reason why [Fact] is a poor choice: "a [Fact] is an invariant statement which is always true". Ok, except when that "example-driven code expression" fails during a build, in which case your [Fact] is no longer a fact, it is something else.

Finally, lets just see how this would work in practice:

"Hey Joe, your facts are failing in the current build".

Here is the bottom-line: all of this smells like people changing things just to be different. I can be convinced to get behind [Theory] for the 'for-all' tests, but until I hear some better rationale, the decision to switch to [Fact] seems arbitrary, and, if I may be so bold, wrong.

Tuesday, April 29, 2008

Running

As I made my previous post I noticed something while linking to the Imaginet (gratuitous link) web site. Once again Imaginet is supporting the Manitoba Marathon with our Hard Drive to the Finish Contest, and it reminded me that I haven't yet blogged about something I've been doing over the last several weeks: running.

My wife and I signed up for a Learn To Run class at our local Running Room, which began about 5 weeks ago. If you're wondering how you learn to run, it is not as simple as the instructor simply throwing us into a gymnasium with a polar bear and telling us to survive until time is up. No, running is a little more involved than that.

The course is 10 weeks long, with one day each week devoted to an instructional presentation. So far we have learned how to properly select shoes, what sort of clothing to wear, how to best incorporate cross-training into our exercise plans, and most recently about how heart rate monitoring can be used to both pace yourself and as an indicator for whether you are actually working as hard as you think are (the likely answer: you're not).

After the instructional portion we go out in a pack and run for 25 minutes or so. The first week started with "1 and 1's", which is to say that for every minute we ran, we then walked a minute. This has been boosted as we progressed to where some of us are currently on "6 and 1's" and others are on "4 and 1's". By the end of the 10 weeks we should all be able to do "10 and 1's" as well as run 5k in duration.

Beyond the once-a-week instruction/run class, students are expected to run two more times during the week. Many of us meet up on Wednesdays to run together, which is nice, and just leaves one run to do alone. My wife and I have taken to bringing our dog Molly along with us on many of our runs, although I'm starting to worry that it might be bad for her to try to run too much as we get running for longer times and distances. I intend to speak with the vet about it this week, at which point I will post their advice here.

The bottom line in all of this: I've discovered that running is actually really fun! I'm not sure I would ever want to give up all of the team sports that I enjoy so much (hooray for Ultimate starting soon!) to focus solely on running, but it certainly is something I intend to continue doing after the class ends. I can't recommend a program like the Learn To Run class highly enough, and I encourage anyone who is even remotely interested to go sign up for something similar. You won't regret it!

And to tie this all together, my wife and I will be running in the relay portion of the Manitoba Marathon this spring. I ran it two years ago without any training of any sort, and while I gutted it out and did ok, I had no idea how to pace myself and the last mile was excruciating. This year I intend to have a goal in terms of time, as well as a goal to pace myself better and not feel terrible by the end. Next year I want to run the half-marathon, so that is my longer term goal... but one thing at a time!

Webinars

My employer, Imaginet Resources, will be starting a series of webinars this spring. Details are just being worked out, but we will be producing one per week on a variety of topics. Currently I am scheduled to host two 'episodes':
  • May 28 2008 - WCF Service Gateways with C# 3.0 and Linq-To-Sql; and
  • June 25 2008 - NHibernate: An Entry-Level Primer
I'll post links to the rest of the topics and further details as they come out over the next couple weeks.

While many of the other presenters are seasoned vets at this sort of thing, this will be my first externally facing presentation. I'll probably post a couple of different thoughts as I prepare, and I will certainly post with my thoughts after each presentation. Hopefully I will learn some things that can be passed on to whichever poor soul Google's the wrong combination of terms and finds themselves at this blog.

Saturday, April 19, 2008

Am I Becoming An Experienced Traveler?

I've now traveled twice since the last time I wrote about my usual misadventures. Once to Vancouver, and now again to New York. And both times, nothing really of note occurred.

For most people this is probably normal, but I am far from a normal traveler and so we should be expecting lots of good material whenever I get sent away from home. Sure I brought the wrong suit to Vancouver and through a quirk in how I unpacked my bag spent about 45 panicked seconds at 6:00am the first morning thinking I had brought no pants. Sure, I pack 2-3 times more stuff than anyone I travel with, including most recently 4 pairs of shoes for 3 days in New York. And sure, I'm still totally awkward in pretty much any situation that involves speaking with hotel staff.

But this stuff isn't really up to snuff; I seem to be getting too good at traveling. We can only hope that maybe next time I'll lose my passport and have to spend a few nights at the Canadian consulate or something.

Friday, April 18, 2008

Should I Become A Rangers Fan?

I was in New York this week for work, and was lucky enough to catch game 4 of the Rangers/Devils series at Madison Square Garden. This was the first NHL playoff game I've seen in person since the Jets left way back in '96, and it was everything I hoped it would be.

The Garden itself is pretty amazing, and the fans and energy of New York just add that much more. There are several cool little traditions that I had no idea existed before I went, which were a joy to discover. I won't detail them all (you can read about them here), but my favorite is the song they all sing after each Rangers goal, followed closely by the "Potvin Sucks!" chant that at the time seemed random. I just love that people are still pooping on a guy that has been retired for 20 years for an incident that happened 30 years ago. Great stuff.

Now, was it as glorious as the playoff games I watched the Jets play back at the Winnipeg Arena in the 90's? No, but it couldn't possibly be. First off, I was in my teens back then, and things like using up a deodorant stick seemed like monumental events. Second off, the white-outs were ridiculously awesome, and ridiculously loud. If you showed up at school the next day with anything resembling your normal voice it meant you weren't really at the game.

But mostly the games back then were better because I cared so much more about who won the game. I read every Jets article in the newspaper every day. I spent more time studying box scores and leader boards than I did doing homework. I watched almost every game that came on TV (the Jets didn't get on TV all that often), and listened to many more on the radio in my room as I pretended to sleep (called marvelously by Curt Keilback).

But once the Jets left, my interest in the NHL declined. I'm still a fan, but now I mostly scan the headlines in the Sports section. I don't even glance at box scores or leaderboards, and honestly don't really know who is in what place in their division until the last week or so of the season. I don't even follow the scoring leaders anymore, despite my annual hockey pool.

Now don't get me wrong: I still love NHL hockey. I watch a few games on TV throughout the year, and I probably watch about 50 games over the course of the playoffs. But with no rooting interest, the results and stats have lost a lot of meaning. After the Jets left I hated the Coyotes. I resented them for leaving, and wanted nothing more than for them to fail badly. Thankfully they did just that, sparing me the fate so many Nordiques fans have tortuously endured.

If I wanted to really feel involved, I needed a team of my own. I had a brief fling with Buffalo during their couple strong years at the end of the decade, but that didn't stick. I tried to like the Canadiens during my 6 month stint in Montreal, but that died out soon after I left. Burned twice by brief flings, I swore off false allegiances and have since simply rooted for teams that played a fun style or had players I liked.

Unfortunately the ramification of this hockey chastity is that I never really get swept up in the games or series' anymore. Sometimes I will really want a specific team to lose (like Devils because I will hate them forever for inventing the trap), but mostly I just watched passively and marveled at individual plays or displays of skill. The only games that remind me of the old days are international games involving Team Canada, but those are few and far between.

So with all of this said, after enjoying a great time at MSG and being quite impressed by the fans and their traditions, is it time to give another team a chance? Should I adopt the Rangers as my new favorite NHL team?

Friday, April 4, 2008

I've Only Been Into It For A Couple Hours Though, But I'm REALLY Into It

I decided that it might be fun to list the stuff I'm currently "into". Theoretically this type of list might inform or inspire a reader to check something out, but the reality is I'm the only one who will read this so it's more just for historical purposes. I think it might be fun to find this blog 5 years from now and remember all the stuff I thought was great back in '08.

As an aside, I really wish I'd made a list like this every year of my life. It would be hilarious to see what 12-year old Dave was all about. I can make an educated guess (G.I. Joe, Transformers, spandex bike shorts, and my brother's-friend's-sister) but I'm sure I'm forgetting lots of stuff and my time line for others might be way off (perhaps 12-year old Dave thinks G.I. Joe is lame now! That was 11-year old Dave, and he was a loser).

Anyways, onto the list. I'll break this into two categories: tech stuff, and other stuff.

Tech Stuff
  • LINQ - In the spirit of Brick Tamland, I love LINQ! I'm not sold on LINQ-to-SQL, but LINQ-to-Entities is the best thing since sliced bread.
  • Lambda - I'm finding some nice places to use Lambda expressions, and it's happening more often. I can even write them without referring to old ones for guidance now!
  • NHibernate - This is really recent, as in this week, but I've finally gotten around to looking into NHibernate and I really think it's cool. Nothing like being 3-4 years late to the party, but whatever.
  • Gateways - I stole a cool Service and DAL architecture from some DinnerNow samples and have used it in a couple of projects now. It uses 'the Gateway pattern' (if such a thing actually exists) and just seems clean to me. Again I'm probably late to this party (and likely butchering terms - terms are not my strong suit), but whatever.
  • Macs - I'm dying to own a Mac. Yes, I am a marketers dream. Yes I'm jealous of Steve and Juan, those handsome, Mac-toting, metro-sexual bastards.

Other Stuff
  • Call of Duty 4 - This is a surprise to me and everyone I know. I hate on games like CoD all the time. I'm not a big FPS fan in general. And to top it off, previous versions of CoD made me sick when I watched or played them. But I've fallen for this one, aided by the fact that 7 of my friends also own it. Private matches are the bees knees.
  • Super Mario Galaxy - No one should be surprised by this. SMG is right in my video game wheelhouse, and it hits a home run. Fun times.
  • Motion-sensing light switches - The bathroom at the office I'm currently in has one, and inspired me to install them all over my house. I will be posting about my experiences soon, I just need to find about 3 hours to type it all out.
  • D&D - My friends and I have been getting back into D&D after a long hiatus. Yes, 30-year old men playing D&D in my basement; we are the uber-nerds. I don't care though, it's been a blast, and soon version 4 will be out and I'll get to soak in a bunch of new rules etc (my personal favorite part of RPG's is reading the books and making characters. Actually playing is merely icing on the cake).
  • Running - My wife and I just started a 10-week class at the Running Room called Learn to Run. I don't think I'm going to become 'a runner' or anything, but the class looks to be enjoyable and will hopefully prepare us to run in the relay portion of the Manitoba Marathon this summer (the other time I ran it my 'training' consisted of using my elliptical machine twice in the week leading up to the race... I did ok, but the idea of pacing was foreign to me and that last mile was pathetic and excruciating).
  • Hockey - My spongee and ice hockey seasons have just ended, but I felt this needed to be listed. Despite my ineptitude, I love playing all forms of hockey. I wish I could get into a summer league of ice hockey. Oh well, maybe some year.

I think that's it for now. I can't wait to review this thing in 2013 and discover what a dork I was!