Wednesday 31 October 2007

Whose Problem is it anyway?

As a developer I on a daily basis make assumptions. These assumptions often vary from whether some sort of functionality is required or if SQL is the best database for the job, or if IE supports a JavaScript event or CSS selector. Now the problem with this is that sometimes our assumptions are wrong. For Me this has happened Multiple times in the last few days, in one case I had assumed that IE understood the 'onChange' event and the ‘target’ DOM attribute. Sadly this was not the case and as a result a JavaScript script I had made only worked in FireFox. This then lead to me wasting another hour rewriting the code so it worked in IE. The issue for me was that IE treated ‘on Change’ events on input fields as ‘on blur’ which lead to the event listener never firing the attached code. Also IE has the ‘original target’ attribute and not ‘target’, most annoying.

Who's to blame?

So whose problem is this? Me as the developer? lE for not supporting all DOM events and properties ? FireFox for supporting the W3C spec? Or even the end user for using a browser as buggy as IE? Of course the problem really lies with the developers. In this day and age it's our job to be aware and able to cater for browser inconsistencies. It's part of being a good developer, and it’s what we’re paid for. We should not rely or make assumptions on how something should work, we should spend a little extra time to ensure our code is consistent and cross browser compatible.

What can we do

In my opinion, check for browser inconstancies should be part of our development cycle. We should try to foresee these issues and ensure appropriate action and code is written to handle unforeseen circumstances. Even if we just catch the error and report in a friendly way that this functionality won’t work. The same principle should be applied to data, all too often we assume data will be neatly given to us in a clean format and that foreign keys are nice int key values so we can perform simple look ups or key bag techniques. This isn't always the case, especially when working with older systems or other developer’s / companies that have a different coding standard than your own. The key to working with data is to know your data, I have touched on this before when I was writing about my Google Data code, unless you know what data you are going to receive and use within your application and how you can use it, your application will never stand the test of time. So what this really comes down to is that as developer's we must stop assuming and check web browsers behaves as we think it should or does. We must check that any data we use will always be in the format we expect, and we must ensure we document our code. If we don’t document our code other developers that may have to / want to use our code won't have to mane assumptions about how our code works and will be able to concentrate on things that really matter, coding, not bug fixing!

Sunday 28 October 2007

Del.icio.us Links For 28/10/2007

Web Site Optimization: 13 Simple Steps [Apache & IIS Configuration] - 26 October, 2007

a good article on site optimization
Link: http://www.sitepoint.com/article/web-site-optimization-steps

Songbirdnest.com | Songbird Media Player - 26 October, 2007

Could this be the future of media players, browser based, XUL goodness? Watch this space!
Link: http://www.songbirdnest.com/

JavaScript tutorial - DOM events - 25 October, 2007

A great article on DOM events, take note of how lousy IE is and workarounds :(
Link: http://www.howtocreate.co.uk/tutorials/javascript/domevents

Videora Xbox360 Converter - Xbox360 Video Converter - 24 October, 2007

For when you want to watch those videos on your nice television through your 360
Link: http://www.videora.com/en-us/Converter/Xbox360/index.html

What are the main differences between Access and SQL Server? - 22 October, 2007

For when you have to turn that old Access DB into a nice SQL baby
Link: http://sqlserver2000.databases.aspfaq.com/what-are-the-main-differences-between-access-and-sql-server.html

Ajaxload - Ajax loading gif generator - 9 October, 2007

For when you need that loading gif...
Link: http://www.ajaxload.info/

Ctrl+Alt+Del - 8 October, 2007

Everyone needs a good online comic to read
Link: http://www.ctrlaltdel-online.com/

Windows XP IIS Manager v1.7 - The Code Project - Windows 2000 / XP - 5 October, 2007

Need to manage multiple sites on iis why not try this out. Its easy to use and allows host names
Link: http://www.codeproject.com/w2k/EasyIIS.asp

IIS Informant: Passwords for IUSR and IWAM - 2 October, 2007

for When you overwrite the IUSR password....
Link: http://www.windowsitpro.com/Articles/ArticleID/21222/21222.html?Ad=1

Monday 22 October 2007

The problem with the XBox 360

Why is it when you have a great product, say an Xbox 360 , which is great by the way, the games, XBox live arcade, need i go on... Theres always a drawback / something which makes you feel robbed... That's right the Media settings, why is it that you can either use the Windows Media Extender functionality or pair it to a Windows PC with the Media Sharing setup. This in my opinion sucks. So ok the Media Center extender functionality is tied to Media Center / Vista, that's bearable but why make it so that a remote device has to be a windows pc! Some of us in the world have Network attached storage, some of us even manage to get their NAS device, which in my case is a nice Linksys NLU2, which ill post about another time, to run an iTunes Media server... Sweet but oh no the XBox 360 does not count this as a device. Which means I'm still unable to play my beloved music collection downstairs with out my laptop. It's even worse when you think I have purchased a fiar few albums and tracks on iTunes, including the The The Hoosier's The Trick To Life and New Young Pony Club's Fantastic Playroom albums recently as part of a birthday gift. and I can't play them anywhere I need to :(

So whats the solution?

Well for one Microsoft will allow the XBox to connect to a normal network share, its not even a complicated Apple or Linux only share, its SAMBA! This will at least allow me to play my MP3s and CD's I have ripped into my computer. The next stage would be for the XBox to connect to a iTunes music share. Now I know Apple are keeping their DRM tech under wraps but for the good of the consumer media devices, which the 360 definitely is, must be able to talk to others and not be tied in to specific brands and technologies. I think we as consumers put up with far too much of this "tied in" attitude. I'm not going to go into the whole DRM debate as this will turn into an essay and not a blog post, but things need to be better supported, cross-platform.

Ideas

One Idea I have had is to write an add on to Media Center, which you can do in Vista although I'm not sure if this then shows up on the XBox? Any know for sure? Which accesses your iTunes and allows you to change its tracks / see whats on, you could then in theory stream your directx output from iTunes to your XBox. This as a concept sucks as your then tying up your PC but it may be a temp solution. Of course getting your XBox to talk to a network share or even an iTunes server would be truly amazing but we will wait and see on that one.

Doing that mobile thing..... revisited

A few months ago I wrote a post about how I was finding the "mobile Internet". At the time I found it to be very good and was very happy with it. On the bus today I had a chance to chance to ponder over my usage since then and if any thing had changed. Now I must say that I use my mobile Internet daily, sometimes I'm on it more than I am on my Internet at home. It really is great on the whole, Opera Mini web browser allows you to view practically any site, MSN means I'm always in touch with people and again the Google Apps, GMail and Maps are always useful when on the move however I have found one gripe. My gripe is how intermittent mobile Internet is on the move. For example when on the bus your be lucky to be able to run msn let alone browse the web. The fact is when your on the move, for 3 anyway, the 3G signal just fades out and your Internet ability suffers. This is vastly magnified when your trying to read your blog feed on Google Reader as every time you loose Internet connectivity your session resets and you have to relogin !?! This annoyed the hell out of me. I'm now thinking when will someone or even Google release an offline rss reader for Google Reader for the mobile device. Now Google already have an offline mode for Google Reader in the form of Gears so I beg the question wheres the mobile edition? I suppose this will come in the form of some Java app which I don't mind about, i just hope you can use the app online, and then download you top 100 or even 50 unread. This would then allow many mobile commuters to catch up with their blog feeds whilst on the move. Here's hoping this happends sooner rather than later.....