Tuesday, 21 September 2010

TCRM and Compliant Web Design

Microsoft have just announced that Internet Explorer 9 beta is now available for download. Amongst other things it boasts integrated web search tools, HTML5 compliance and a shiny new slimline interface. That’s right, this means this brand spanking new product is offering what it’s competitors currently do, but the main event though is the collective sigh web developers around the world, and Bridgend Web Designers in particular, are making as they foresee more blood, sweat and tears to make their websites compatible with the software giant’s latest offering.

In the ideal world all browsers will follow the agreed upon standards to the letter and us developers can plan our websites to the standard even before the new browsers are written because they will all act as set out in the standard. In this world cheeseburgers are also free.

Reality is a grim dark world filled with quirks, workarounds and those little CSS bugs which turn a simple menu update into a eight hour slog, by the end of which you question your career choices. I had to deal with one such bug this week. PDF files created on the fly using PHP are a very powerful tool and a useful addition to any website. Even though the file itself is a PHP file, by specifying in the header that the content of the request response is a PDF file, the browser treats it as such. Well this is how it’s supposed to work, and does work like a dream in Firefox. IE doesn’t play by the rules. Rules are for whimps and IE is a big boy with long trousers and everything. IE just looks at the filename in the URL and goes from there. If it sees that the URL ends in .php, it interprets it as a PHP. You can see the problem here. The only working solution for our PDF writer is to create a temporary PDF file and redirect the browser to that. It’s just these little workarounds and fixes which can suck up the effort.

Because of these bugs developers have to react to new browsers coming out instead of planning for their release. Developers have to wait until they get their grubby little hands on the browsers before they can write websites for them as we need to see what quirks and how closely the standards have been adhered to.

Unfortunately, for web design companies like TCRM, it just is not possible for us to stop whatever we are doing and expend effort in getting every one of our sites up to date and debugged with the latest browser versions. If it’s not IE 8 it’s Firefox 4. Then Chrome etc etc (though Kevin isn’t the fan of Chrome I am). The most stable and cost efficient solution is to aim to be compliant in the last-but-one version of a browser. The knowledge base has grown so fixes are available for most major bugs and the industry as a whole tends to work in the same direction. It’s not perfect, but it’s the best solution for the mess out there.

Friday, 10 September 2010

TCRM and Web Design Paradigms

So what sort of programmer are you? Do you sit there with your pad of paper working through the logical process of the website drawing arrows, boxes and those little annotations with curving little pointers all over the place? Or are you from the rough side of the geeky tracks? Do you play it fast and loose by hitting the code first and hacking away until you get something that works?

I belong to the former category. The idealist programmer. I like to think and plan through every aspect of the site before even thinking about producing one line of code. I like the boxes with arrows pointing to other boxes, lists of functions sorted by category, and roughly draw entity relationship diagrams complete with crow’s feet. When I do start to code I like proper indentation, good naming conventions and nicely written comments all over the place. But us idealists tend to produce at a slower rate, more concerned with how good the program is rather than the fact it is completed.

Kevin on the other hand, belongs to the latter group. The pragmatic programmer. He sits down in front of a screen and starts coding until a solution is reached. The resulting source is not pretty to look at (indentation is for wimps), can be hard to follow and naming conventions go out the window. I once saw someone’s code (not Kevin’s) in which they had called a variable ‘variable’. It’s that sort of thing that makes me and other idealists like me wince. However, it tends to be the quicker method for getting out the first version and usually results in a working product. Not pretty or elegant, but by god it works! They are pragmatists after all.

So you have an idealist developer from Bridgend and a pragmatic developer from Neath. Neath Web Design verses Bridgend Web Design! You would think that this difference of approaches would lead to many arguments, a lot of yelling and stamping of feet and sulking in the office. When I first thought of writing about this subject I though to call it ‘TCRM and the Clash of the Paradigms’, but the further I got into the content of the post the more I realised how this just wasn’t the case. There are very few actual clashes. No raging arguments about function names and third normal form and almost nothing more than a raised eyebrow when it comes to generating JavaScript using PHP echoes (I don’t care. It’s fiddly, difficult to debug and looks bad). Very odd.

It turns out that the best of both worlds for a development team is somewhere in the middle. Staff a team with idealists and you’ll be knee deep in relationship diagrams without a single line of code written with only two days of the project left. Fill it full of pragmatists and you’ll end up with lots of undocumented code that’s difficult to debug and almost impossible to move forward to version two. Get a nice mix and good things start to happen with your products. The pragmatists drive the project forward and the idealists insert a bit more structure. Pragmatists will rein in the idealist’s ever expanding requirements so version one is delivered and the idealist approach will mean version two takes less effort.

It is important to know what sort of programmer you are, and what the other members of your team are like. Would you say you are happy with the balance or is it too in favour of pragmatists or idealists? Don’t be afraid to mix it up. The results are pleasantly surprising.