The blog of Eric Sibly; focusing on mountain biking, .NET development for the Desktop, Smartphone and PocketPC.

Friday, April 29, 2005

Avalon video...

Here is a great video of Karsten Januszewski, a technical evangelist, from Microsoft doing a presentation of Avalon. From this you will see why I am so excited by this new presentation platform - it rocks!

Thursday, April 28, 2005

Microsoft kill off PowerPoint...

Well the title might be a little misleading, I don’t think Microsoft are about to kill off PowerPoint! But I wonder whether its days are numbered in its current incarnation. Let’s see, it is great for presentations; you can add text - rotate it - color it – shade it, add shapes and do the same, add pictures or vector images - and if you are really feeling that way inclined some basic animation can also be added. This is all done using Win32 and GDI, not with Direct X, and your GPU is left largely idle (correct me if I am wrong). What a waste, what a shame!

Now, with the introduction of Avalon – the new presentation layer for Windows – it can do all of this natively, and more, all utilizing the GPU and supposedly glitch free – nice! So if PowerPoint is a primarily a presentation tool then wouldn’t it make sense for this product to also utilize this platform versus providing similar functionality as it does now – and doing it in a less impressive and performant manner. So will the new PowerPoint files just become a refactored version of XAML (Avalon markup) as this is what is used to describe the elements and how they are to be displayed and animated – then the Avalon presentation engine can simply be used to perform the rendering?

If this is so, then PowerPoint will just become a nice front end to XAML, like a bunch of other designer type tools – except, it will hide some of the XAML features that would be typically associated with an application, for example user input. It would then also provide the ability to play out the presentation and add additional other features, such as note taking, etc.

When you think of it, a whole chunk of PowerPoint will now be made redundant and become part of the Windows platform for everyone and every application to utilise – that is awesome!

Thursday, April 21, 2005

Namespaces and Assemblies...

There is quite a good video of this on MSDN that discusses namespaces and assemblies. Too often I have seen project/assembly overload; where for each and every namespace there is an associated assembly – where it would be simpler to create a single parent assembly at a logical root within the namespace and include all children keeping the original namespaces. There are very good reasons for these, supported by the following key points that really resonated with me within this video:

Factor functional into assemblies based on:

  • Performance: There is overhead in loading each assembly - all other things being equal, the fewer assemblies an application loads the quicker the load time
  • Versioning: All code in an assembly must version at the same rate
  • Security: All code in an assembly has the same identity and is granted the same level of trust

Assemblies and Performance - Prefer single, large assemblies to multiple, smaller assemblies:

  • Helps reduce working set of application
  • Larger assemblies are easier for NGEN to optimise
  • Where several assemblies are always loaded together, combine into a single assembly

Assemblies and Servicing – Ease of Use:

  • Fewer DLLs are easier to use than many - easier to deliver, set up, build with, and maintain

Assembly Version Number:

  • All four parts of the version matter (...)
  • You can't change the revision and have binding still work
  • Assemblies should use version numbers - considered part of the assembly's identity

Namespaces:

  • They can span assemblies - consider moving designer or obscure types to new assembly

Let's consolidate and keep it simple ;-)

Wednesday, April 20, 2005

Coding guidelines...

I am still amazed at the number of people who are coding in .NET who still do not understand the basic coding guidelines. For example, when to use a properties, when to use camelCase versus PascalCase, how to handle exceptions, etc. So if you're not sure, visit here for a quick refresher. Also, I would suggest subscribing to Brad Abrams blog where a wealth of fantastic information regarding this subject awaits you :-)

Also, for all those developers out there - consider visibility - in when to expose as public, protected, internal and private, whether to support overrides, whether to make a class abstract, etc. These all ensure that the code you author is used properly and not abused by consuming developers (typically accidentally) by ensuring members can not be used where inappropriate. So, consider whether you want to allow a type to be instantiated outside of the owning assembly, whether a type can and should allow for inheritance; and whether a method or property can be overridden (if in doubt, don't!).

And finally, for all your public and protected members *please* remember to validate. Check for nulls and check for invalid ranges and throw ArgumentNullException's and ArgumentException's. This is preferred to assuming you will get passed valid data and then getting a runtime exception; i.e. when you attempt to access a property of a type and get a resulting NullReferenceException. In my opinion these are pure evil and are the result of lazy programming. So validate and save your consuming developers hours of debugging by throwing bad data right back at them!

There concludes another rant - have a nice day ;-)

Monday, April 18, 2005

Want the skinny on IDisposable...

Check this out; this provides the skinny on IDisposable and Finalization. This is from the team at Microsoft spilling the beans on exactly how this is meant to be coded.

Thursday, April 14, 2005

Dell LCD Monitor with TV...

Dell have recently released the Dell TV which is basically a 19" LCD Monitor with TV tuner; that can support picture in picture with your computer etc. I like the concept of having this great monitor for my computer that I could conceivably move to another room and watch TV – kinda cool that I would not need another TV for this function as I would unlikely be performing these functions at once.

I would however like this to go to the next step! Why can’t we have it such that there is an option that the built in tuner bypasses outputting directly to the monitor, and instead provides an output to hook it up to up to my computer via say USB2? This would then let me use the likes of Microsoft Windows Media Centre to control the TV tuner and also record to my hard drive etc. and allow it to control Picture in Picture. The monitor would also compress the TV input to MPEG2 or WMV in hardware improving performance.

Now I like this approach as I only own a laptop so I would like to avoid the external USB tuner if possible – just more clutter on my already cluttered desk. And for those folks who own a desktop then just think this would be one less card slot being used up.

Anyway, my random thought for the day ;-)

Wednesday, April 13, 2005

ZAM 3D...

Wow, Avalon is getting seriously close with the latest CTP and now we can start to see some seriously cool 3D applications coming out to support this very exciting technology. Check out ZAM 3D which is a 3D editor which can export to XAML (the markup language of Avalon) - as per this post from BradA.

Am going to have to improve the artistry skills to avoid creating some seriously ugly applications; remember when everyone started creating Web pages back in the 90's and how ugly they were [yuck] - let's hope we don't repeat all of that! One thing I have learned over the years is that most developers really do overrate there UI look and feel skills, great code behind - but look and feel - ew! So it will be about time for us developers to embrace our designer friends and work we them to create the coolest applications - I for one can not wait :-)

I wish they had picked a better name than Avalon, as that was the name of a suburb I used to live near in Wellington NZ when I was a kid - not a great place! Am struggling with the connection between this way cool looking technology and this crappy suburb - ah well - guess they weren't to know!

Monday, April 11, 2005

Issues with Serializing DateTime...

It must be my once a year issue - weird. Over a year ago I was on a project and we were having all sorts of problems with the serialization of the DateTime data type; especially where we were not interested in the time portion. Because of time zone changes the date would end up being changed on the server as the time was never updated from 00:00:00 as it was considered irrelevant – but is included within the serialized value. Consider your birthday for example - you're never generally asked for the time when entering on a form and it should be time agnostic – you would celebrate it on when the day it fell in, whatever time zone you are currently residing.

So most would use a DateTime and ignore the time, so it would be "1970-01-22 00:00:00", but the serializer adds an offset for the timezone, say "+10". Now, along come daylight savings or timezone change, and it gets refactored to "+9", now I am born on "1970-01-21 23:00:00" - What the?

About a year ago (to the day) I send a note to BradA from Microsoft (my original question is included as the “reader asks”), and this is his reply plus a bunch of other comments left that may be of interest.

So today, I called into a different project that was having issues with timezones. So it was back discussing the cons of the DateTime serialization under .NET 1.x, and some basic workarounds.

There has been talk of changes/fixes in .NET 2.0 for this; however, I have not been able to find anything tangible on the subject :-( Update: Just found this, although it still doesn't sound like a great story.

Some firsts this weekend...

Just had a great weekend with the kids – with a couple of firsts!

First up on Saturday, it was Caleb's first game of soccer for the year. It was just so funny watching all these 5 year olds running around following the ball like a swarm of bees - brilliant. And the parents are great too - all on the sideline yelling and screaming - in good natured way of course! It was a closely fought match that finally ended in a draw, 1-1. Best parts for Caleb, were doing lots of running real fast and having oranges at half time :-)

Sunday morning was Kyle’s turn. He entered the Weet-bix Kids TRYathlon in the 7 year old category, his first ever triathlon. It was a 75m swim, a 3km ride and a 500m run. He was really nervous before the event but really got into it once he started; the swim was the hardest and he managed to complete the distance, then it was onto the transition with some challenges getting his shirt and shoes on. Then off on the ride, his strongest of the three – once complete it was time for the run, which he did really well as he is not the best runner. In the end he completed it with a huge smile on his face, and is already talking about doing it next year. Awesome!

As they say, Winners are Grinners – that was all of us this weekend.