Monday, October 24, 2005

Great C# 2.0 Iterators article

Comprehensive article covering C# 2.0 Iterators

Monday, October 10, 2005

Interesting VSTS dogfood document

It's always reassuring to know that Microsoft promote dogfooding.

There is an interesting VSTS dogfood document that gives out some useful nuggets

Sunday, October 09, 2005

Drink the Kool-Aid suckers

I feel compelled to share an experience I had yesterday. A friend of mine suggested that I attend a 'free' 2 day "personal development" seminar. Having only a cursory knowledge of the subject, my default reaction was one of pure skepticism. But, I decided that this negative, stick in the mud attitude could do with a shake up. After all, how could I refuse the tempting offer of "Can You Attend A Legitimate, $1,197 Personal Success Seminar for Free? Yes. It’s absolutely true …"

The organisation running the event has the exceedingly dodgy company name of Success and You. A quick scout around their abysmal website reveals that it was built in a hurry on a limited budget – not a very compelling first impression for a company that touts success as it’s unit of currency. That aside, I paid the $69 towards the food that I would eat over the 2 days and was duly enrolled.

The event format is two 12 hour days of "intensive success" training. Hmmm. Well anyway, I turned up for the event at 8am on Saturday morning to be greeted by a small army of clones wearing black trousers with white t-shirts. These were the volunteer helpers who were attendees at previous seminars. My friend is one of them by the way. They all seemed very excited which was promising.

The gig got underway as we took our places in the university style auditorium. I was one of about 70 attendees. The opening speech by Craig the Queensland head honcho promised incredible things over the 2 days. He finally built up his boss Peter to be the greatest speaker ever which seemed quite a dangerous thing to be doing. Craig appeared to be nervy and had stacks of closed body language, holding his clutched hands close to his chest all the time in a prayer like manner.

By contrast, Peter offered a more slick performace. He has a lot more confidence and therefore charisma than Craig, but experience is all when it comes to training. Between them, they give away nuggets of largely content-free information delivered in a deadly combination of lectures, video and games. The lectures are backed with a very badly put together powerpoint slide deck. Diagrams of triangles divided into 5 layers with words stacked on top of one another like "environment", "beliefs", "actions" etc seem to go down quite well with the audience. The fact that the triangles are badly drawn with some lines not quite meeting at the places they should meet does not appear to create a bad impression with the attendees.

Having subsequently been broken out into various teams of approximately 10 people per group, the team I am assigned are blessed with the decidedly crap name of "the donkeys". We were advised that our team would need a chant of some sort. Before being allowed back into the auditorium each team must give its chant and it was here that for me the downward spiral began. Watching adults make lion / kookaburra / donkey noises when playing with children strikes me as perfectly normal. Watching adults make lion / kookaburra/ donkey noises when there are no children around strikes me as very embarrassing.

Upon entering the auditorium after each break, for about 10 minutes they play the same loud pop music that everyone must dance to, having previously been been whipped into a collective chanting frenzy by one of the clones: "we love dan-cing". Drink the kool-aid.

I found myself feeling increasingly isolated as I watched my fellow sheep participate in what was rapidly becoming a sham punctuated by moments of pure, unadulterated embarrassment by their induced childish behavior. The techniques being used by Peter and Craig are not new – apparently they are used by the infamous Tony Robbins.

The pre-dinner session was a practical game. Two breeze blocks separated by about a foot are setup to support an inch thick piece of pine. The goal of each attendee is to break their pine block on the breeze blocks. After watching a couple of demos from Peter and a clone, each attendee signs the legal document that surrenders any chance of you suing their company for a damaged hand.

It turns out that breaking the wood in the manner shown is trivial, so long as you use the procedure demonstrated. The trick is to focus on the floor below the wood. This ensures that when you make contact with the wood, you carry on through to the floor, thus breaking the wood in half. The audience is encouraged to yell in support and to hug fellow attendees as they complete the task. Rabble rousing in this manner is incredibly embarrassing to be a part of, especially if you are English like me!

The idea behind breaking the wood in this way is for one to achieve something that ordinarily one would perceive as being impossible. In doing so, it is demonstrated that we often give up on an idea before we have even given it a go. Once the average person proves to themselves that they can break the wood in half, they have clearly demonstrated to themselves how their negative attitude can often prevent them from getting the success they desire in life. On the whole, I must say, I think this is actually a clever device for the less confident lemmings in the audience. For myself, I knew I could do it because I had watched Peter do it and thus I had confidence. I was not the target audience for the game.

At the end of day 1, I realized that everyone in the room had taken the blue pill and were sitting happily inside the matrix chanting, yelping and doing whatever Peter, Craig or the clones desired from them. For myself, I felt like I had taken the red pill and I knew I was no longer a part of their world as my fake mobile phone calls and extended coffee breaks made me realize that I would not participate any further in the show. I felt tinged with slight sadness at being abnormal and probably over analytical to be a seminar reject but I cannot help being me. As for the sheep who go on to attend day 2, my heart is with them in a spiritual sense as I hope they won't be lulled into spending upwards of $125 per hour for success coaching after the event. I say this because the website makes the following pitch to wannabe success coaches: "Become a Success Coach...in only 3-4 months time, you could easily be earning $125 an hour". Yikes!

Wednesday, October 05, 2005

LINQ musings

Having missed the PDC, I just watched the very compelling demo of LINQ from Anders Hejlsberg on Channel 9

It gets a little interesting right at the end when they bring up the topic of *where* Database LINQ queries are invoked. His demo of using LINQ over Northwind database is basically middle tier code. He suggests that queries can be written in the middle tier (which is what he demo'd) and updates be implemented as stored procedures called from LINQ in the middle tier. I know some people will be needing some guidance on this as the preferred practice is to always invoke a stored procedure to access the data, if only to introduce a security perimeter.

There is no doubt that LINQ is a compelling addition to the managed language suite. Being able to issue relational queries over objects/XML and data is both amazing and freaky (in a good way of course). I recall spending my days at Uni avoiding woosey SQL, staying focussed on chest-beating-hair-adding C. MTS lured me out of that hidey hole and LINQ will clearly barracade the entrance to it behind me once and for all....this is most definitely a good thing.

The single most important thing Anders says in the whole interview in my opinion is that LINQ allows you to focus on *what* you want to achieve *without worrying how* to go about achieving it. His final demo using reflection over System.String class to do ordered filtering would have been many foreach, drill down lines of code in C#. LINQ does to C# what .NET did to COM....it raises the level of abstraction. This is a also a good thing.

Not having the PDC bits is a little frustrating because I am intrigued to examine the CIL of any of Anders simple programs. He mentions that it's all type safe and not using reflection which is obviously good to hear...it would be interesting to see what the relative performance trade offs are when using LINQ over data as opposed to going the traditional route of cooking up the usual SqlParameter/SqlCommand/SqlConnection. One suspects that over a long enough period of time that the cost of the LINQ abstraction will be paid for in much the same way as GC has (is being)