Monday, January 22, 2007

Fear and Loathing in Software Development

CodeMash was a great conference. There were a lot of opportunities to learn and grow. But some things I heard from more than one person there is a bit of a "dark side."

No one can deny that there has been a lot of churn in the world of .NET and development in general lately. You've got the .NET 3.0 framework, offerings from Microsoft like Service Factory, persistence layers like nHibernate and tools that change the way we develop as a team like Team Foundation Server. You also have things that effect all platforms like SOA, Web Standards and Section 508 compliance. Add to all this LINQ which will be out before the end of the year and whatever Microsoft unveils at this years PDC and it's a lot to get your mind around.

But, when I hear my contemporaries say things like:
  • "Well, I'm not that interested in LINQ. Sure, it sounds good, but it's probably too complicated and who knows how long Microsoft is going to support it."

  • "Sure, Windows Work Flow sounds good, but no one here knows it and I probably can't find anyone to hire who does. I probably wont use it."

  • "Yeah, I know we should use CSS for things like styling and layouts, but it looks too hard and I don't feel like learning it."

  • "Smart Client would fix a lot of our issues, but it looks too hard to learn."

  • "Sure, Service Factory presents all the best practices of web services, but it just seems like a lot of work, so I'm going to just continue to shove everything into one project and not care about scalability or re-usability."

  • "I know Section 508 is the law, but it sounds really complicated. I'll just cross my fingers and hope the Feds never take a good look at my website."

  • "I bet I would learn a lot at that conference, but I'm not making up two billable days to go!"
it tends to be a little depressing. Especially when you note that the common theme is "This is too hard and I don't feel like putting forth the effort. Why can't just do things the way I've always done them?"

The bottom line is this; technology is an engine. You are either on board helping to lead the way and define the way things are going to be or you are behind it, watching it and your carreer get further and further ahead of you until you can't see it anymore.

It's up to you; the tools and information are out there. Use them or don't. But don't bitch when the train leaves you at the station.

Please note, the above quotes are not ment to single anyone out. I've heard them ALL in one fashion or another from a lot of different people on a lot of different occasions.

Sunday, January 21, 2007

Codemash roundup: LINQ is the word.

Well, it's the Sunday after CodeMash, and I've had a chance to collect my thoughts about the event.

In short, it was a terrific event, and I am really looking forward to CodeMash '08. Aside from the technical content (which I'll cover below) it was a great opportunity to meet up with some people I hadn't seen in a long time and catch up, and to meet some new people in the industry. It was interesting to see what not only fellow ".NET-ers" were doing, but to also check out what's going on in the Java and Ruby camps. I even attended a Java session myself! More on that in a bit.

Given that it was the first conference that these guys had done, I thought everything went INCREDIBLY smoothly. I was drafted into working the registration desk for a few hours on Thursday, and the very small number of people asking questions about what was going on was a testament to that.

The facility was nice, although it wasn't hard to see that this was the first "big" event they had hosted. The water park looked fun, but I chose not to indulge for a couple of reasons. It was very nice and convenient to have the lodging and the conference in one facility; no running to catch shuttles, no standing in the rain/snow/heat/whatever and if you didn't want to cart your swag around all day you could just stash it in your room between sessions.

OK, now on to the technical.

As mentioned, I did attend a "Java" talk. Todd Kaufman gave a presentation on Spring. I attended because I know Todd and have seen him present and wanted to throw some support his way. I also know that there is a .NET version that I've heard some interesting things about, so I wanted to check it out. To be honest, some of the Java specific stuff kinda threw me, but I was able to follow along. I'm planning to install Spring and give it a shot.

I also enjoyed Neal Fords keynote on the first morning. It gave me a lot to think about. The fact is, people are already using DSL's and don't even know it. Do you use Service Factory? You are using a DSL.

Some other high points where Kieth Elders Smart Client presentation (I only caught the first half, I understand the second half had mixed reviews) and Drew Robbins presentation on Vista Sidebar Gadgets.

Kieth had some good points about advocating for Smart Client systems and it's something I'm definitely going to offer by way of suggestion to my clients. Some might be open to this. Some, mostly the ones who have drunk the "Web 2.0" Kool-Aid might not, but it never hurts to try. Being and admitted "object-snob" I was a little concerned to see him using datasets. Not because I think he shouldn't have used them in the context that he did, but because I've noticed that a lot of developers want to use them for EVERYTHING. I'm trying to break the cycle of dataset madness, and I was mostly worried that a response to my efforts would be "Well, Kieth Elder uses datasets."

Drew gave a really interesting kind of "see spot run" overview of Vista gadgets. I can see these being particularly useful in an Enterprise environment. The "big thing" now is dashboards and Enterprise Platforms. But, most people don't want to necessarily have their dashboard open all day, especially if it isn't their primary work surface. I see gadgets being useful by allowing a small-footprint, non-intrusive way for people to monitor important information about their organization without impacting how they do their day-to-day work. Right now not enough of my clients are using Vista, but it's definitely something worth keeping in the tool-box for later.

I was planning on attending Josh Holmes presentation on SOA, but he told me that he would be here (in Columbus) next week to present it at the next CNUG users group, so I guess I have to wait a week.

The "big" thing of CodeMash, at least for me and I imagine the rest of the ".NET-ers" was Scott Guthrie speaking, mostly about LINQ.

To be short, I think LINQ is going to be the "next big thing" in the world of .NET. .NET 3.0 (WCF, WF, WPF(/E)) are all great technologies, and represent big leaps in and of themselves. But they don't approach what LINQ is going to do.

I'm not going to go into explaining what LINQ is. If you are reading this and you don't know you either

  • Aren't in technology and don't care

  • You are in technology and don't care enough

What I can tell is you what LINQ is to me. LINQ is the bridge between the idea of data persistence and domain objects. Datasets continue to be used for a lot of database access, and I personally don't like it. Datasets are inefficient. Datasets are heavy. As a developer, I prefer to think in terms of things like customers, accounts, orders, addresses, etc. and not in terms of a field in a representation of a table in a representation of a database. Most importantly, unless you have a bunch of business logic in your database (and why you would put it there is beyond me) datasets don't force you to do any business level validation before saving your data. LINQ is also an easy way for me to find the data I need easily in large collections. LINQ is going to change the way people think about data and data persistence. It's going to be out (officially) later this year and I can't wait!

And finally, the coolest thing about CodeMash was that I was one of several people who were invited to have lunch with Scott Guthrie on Friday. (Thanks Drew!) It was quite an honor, and I think a lot of the .NET people were a little "star-stuck." Alexey definitely had a bit of a "boy-crush" going. But who can blame him. The lunch was great and there was a lot of thought provoking discussion. It was an honor to be invited to attend.

I almost forgot one last thing! A final highlight (or, lowlight depending on your point of view) was the Brian Prince/Josh Holmes head shaving. I guess I should explain for those who missed it; at the end of Neal Ford's keynote on the first day, Josh made a deal that he would shave his head at the closing if there were 500 blog posts about CodeMash. Brian Prince upped the ante by saying he would do it for 600. At the end of the closing, Technorati was fired to up to get a final count and.... Technorati was down. Yeah, kind of anti-climactic. But, Josh made a deal with the crowd that if we all went home and blogged about CodeMash, he would do it. Somehow Brian got roped into this too, and off the hair came. Amazingly, a cursory search of YouTube did not produce a video. Keep checking.

Good luck guys. I hope it grows back. It doesn't alway you know... :)

Friday, January 12, 2007

Lazy Loading in a SOA world.

As a "side effect" of my current project, I am helping my client build a SOA interface to another large system. This client has traditionally used datasets for most of their data access, and one of my goals is to get the harsh dataset monkey off their backs and wean them onto the smooth, mellow high of business domain objects. After all, all the really cool Enterprises are doing it! I'm also trying to champion the "One interface to rule them all" cause, so this (eventually) will be the ONE and ONLY way to get data from, or put data in this system.

In putting together a proof of concept, I came across a bit of a problem; my entity has several properties that return lists of items. Some of these lists can be quite large, so we want to lazy load them. For my example, I created a person, who had a list of four address (I’m just returning four hard-coded ones since I didn’t want to muck with the database for the proof of concept) which I wanted to lazy load. I wired everything up and it was working beautifully!

Except for one thing; I was getting eight addresses back.

Here’s the problem; when the web service was getting ready to send my person object back, it was serialized by the XML serializer. That serializer was looking at my address property, which caused a lazy load. So, my object was initially coming over the wire with all the lists populated. One the client side, the de-serialization was also calling the address property, which was again lazy loading the address right away. I had a check in the “get” to make sure the list was null before the loading occurred, so how BOTH lists got merged together is something I can only wildly speculate about at this point, but it was merely a side effect of a different problem, so I didn’t worry about it.

The solution was to find a way for the XML Serializer to ignore that property when it was sending it out.

The solution: the XMLIgnore attribute. Decorating my property with this attribute causes the serializer to skip it. It doesn’t get looked at during serialization, it’s ignored during de-serialization and my lazy load routine work beautifully.

And all was well in the kingdom of SOA (for now…)

Thursday, January 04, 2007

My New Project

Having just acquired a shiny new XBox 360, noting the release of XNA Game Studio Express, and being the curious little geek that I am, I have decided to try my hand at writing my first video game.

The Concept

Instead of trying to come up with my own game concept the first (maybe only) time out, I am "borrowing" a concept from someone else. The board game Ra. This is basically a game where you bid on tokens to amass points and crush your enemies in a most humiliating manner. I first played the game at Brian Anzalones house several years ago, and despite my less than .500 average enjoy it. From what I've seen, there is no other game available on XBox quite like this (sorry FPS fans, it's not an "action" game) This choice was also out of practiality; I've never written a game before, and didn't want my first attempt to be saddled with having to learn how to do animation, physics, collision detection, lighting and other stuff in involved in action games.

This is a nice, simple, civilized board game. Just my speed first time out.

The First Feature Set

Being a fan of agile development, I will be creating this game as a series of features to be deployed on an probably very irratic and unpredictable schedule. The goals for my first release are:

  • Target for the XBox 360 platform

  • All basic rules and scoring in place

  • Playable against others via XBox live
Once I get these things working, I'll look into developing an "AI" to facilitate single player games, but being my first game I want to start kinda small.

The first step is going to be setting of the XNA Game Studio on my home machine. It looks like I'll need to pay the $50.00 a month, but hey, knowledge is it's own reward, right....?

I'll be sure to blog about my progress. In the meantime, if you would like to be on my list of "beta testers," send me a comment and if I don't already have your XBox Live ID, be sure to include that.

Was this one of your New Years resolutions?

As most of the hits on this blog over the past few days have been on the “lose weight” pages and as the new year brings many people to resolve to lose weight, and as a means to that end many people will join a gym and in order to continue my promised series of articles on the subject, I bring you this next installment of my “lose weight” series.

This time, I’m going to discuss exercising. By means of a reminder, I will switch back and forth between exercise and food as the series goes on.

Why do I need to exercise?

A lot of people will try to lose weight by just dieting. This will only work in the short term. Please see my previous post as to why.

Some people (particularly women) will say they don’t want to lift weights because they don’t want to “get big.” You don’t have to get big from lifting weights; even toning will help to increase your health and your metabolism. And ladies don’t need to worry; without “additional help” (roids) you will not get big. Women simply don’t have the body chemistry to get big. You will get “ripped” but it will be more of a “swimmers body” than a “meat-head” body. Think Madonna, not Arnold.

Gear up!

If you’re just starting out, don’t spend a fortune on work-out gear. A comfortable shirt and pair of shorts should be fine. Women might want to invest in a good sports bra. Clothes should be comfortable and easy to move in, but not loose. Good socks are also a must. For just starting out, a good pair a cross training shoes are important. Make sure they fit! I’ll do another post on gym ware (where I “name names”) later. For now, don’t spend a ton of money.

As you’ll see below, monitoring your heart rate is important. A heart monitor may be a good investment. Get one with a chest strap; the ones that take your heart rate via the finger sensors are useless for working out. Polar makes some great ones that range from a simple model that will only tell you your heart rate to models that have built-in MP3 players and GPS systems.

Don’t bother with the “Nike+iPod” stuff. The only remotely pertinent information it gives you is distance run. In spite of the marketing fluff it can not give you accurate pulse rates or calories burned. Those figures just can’t be computed from a motion sensor in your shoe. If you really want to get the distance retrace your path in your car. If you want “super accurate” numbers, run on a track. Better yet, don’t worry; time and heart rate are more important than distance.

OK, so what do I do?

I work out six days a week. Three cardio days and three strength training days. Here is what I did when I was starting out. I’m not going to give you specific weights, rep counts or “Stair Master” levels. Those things aren’t important. What’s important is your heart rate. More on that later. For the most part, you should spend no more than an hour in the gym each day. But, it should be a good (not wasteful) hour.


Regardless of what kind of work out you are doing, you need to warm up and stretch beforehand. Warming up should be about five to seven minutes. The goal is to not be sweaty or out of breath at the end of the warm up, just a little looser. If you’ve ever tried to run from a “cold start” you’ll know what I mean. It’s just to get the blood moving a bit.

From there, you should spend about ten minutes stretching. Again, this is to loosen up and ensure that you won’t pull any muscles or injure yourself. I will at some point write a more detailed post on stretching, but for now check this site out.


I do cardio Monday, Wednesday and Friday. I do at least 30 minutes. I alternate between the Stair Master (the one that looks like a very short escalator; the other style is a waste of time), the cross trainer and running. If you have access to a pool, swimming is great. Biking is OK, but since you’re sitting your legs don’t support your body weight, and you’re not getting as good a work out as you could be. But anything is better than nothing.

When performing any cardio exercise, do not hang on the machine like you are clinging to it for life. It means you are going too fast. Lower the speed/intensity/whatever and do it with proper form. You will be a better work out and get results faster.

If you are under 220 lbs., running once a week is OK. If you are heavier than that you could run into problems with your legs. Try just walking on the treadmill with a steep incline. If you weight more that 220 and MUST run, try to only do it once every other week. If you start to feel sharp pain in your knees (before, during or after) stop immediately. If you run on a track, or outside or anywhere except a treadmill, be sure to switch directions every time you run. Your legs will thank you.

When doing cardio, you should try to reach and maintain your target heart rate. What is that? It’s the heart rate at which your body is working hard enough to burn fat. There are a couple different ways to figure out what yours is. The easiest way (although not super accurate) is to subtract your age from 220 (226 for the ladies). If you are already pretty fit, that 70% of that number. If you are “so-so” fit, take 65%. If you are a total couch potato, take 60% of it. That’s your target hear rate. If you want a more accurate measurement, and know how to correctly take your own pulse, this site has a calculator that is OK. If you want to be “hyper accurate” contact your gym. There are a couple of different tests they can administer to calculate this that range from cheap and quick to expense of drawn out. Don’t pay too much for this though, your target heart rate will change as you begin to get in shape. And don’t be a slave to this number. If you can do a little more, do it. If your below it but feel like you are about to die, than don’t push yourself. You’ll get there, just give it time.

Weight Training

Weight training does not mean you have to get “big.” It can be as simple as toning and strengthening your existing muscles. Everyone should do it.

The major muscle groups for weight training are;

  • The Chest (bench presses, push ups, flys)

  • The Shoulders (shoulder presses, lateral raises)

  • The Arms (curls, overhead extensions)

  • The Back (rows, reverse flys)

  • The Abdominals (crunches, planks, in and outs)

  • The Legs (lunges, squats, “super-legs”)

This page has a good explanation of most of these.

With the exception of the abs and legs, you do NOT need to work every group every time.

In general, I try to use dumbbells for all of these. You can use machines for some of them, but free weights help keep you honest, and make you work the “stabilizer” muscles which increase your overall strength. Additionally, I use dumbbells as opposed to barbells so that each arm has to work independently. This ensures that everything builds up symmetrically.

When lifting, go slow. Don’t jerk or swing the weights. Besides keeping you from injuring yourself, it will make sure that you are really working the muscle and not letting physics do all the work

Gym etiquette

It’s important to know how to behave in a gym. I’ll do another post on this, in more detail later. For now:

  • Do not drop your weights. If they are too heavy, move down.

  • Put your stuff away when you are done with it. This includes un-racking weight plates from any machine or bars you have used.

  • Don’t monopolize equipment. Let others work in during your break. If the other person was there before you, reset the weight pin to their weight for them, or help them move plates when switching.

  • Wipe off equipment when you are done. Even if there is no visible sweat do it anyway.

  • Socializing is OK, but not everyone is there to talk. Keep that in mind.

  • When socializing, keep conversations from getting too loud and keep the language “PG.”

  • Mind your surroundings and respect others personal space.

  • Don’t leave a mess!

That’s enough to get you started. I’ll post more in depth on some of the topics I’ve covered here later.

Good luck!

Monday, January 01, 2007

What were your plans for New Years Eve?

Maybe just hanging with your buddies?