One of the thumb rule for any CMS system is:
Have just one instance of the content and define templates/components/modules/elements to render it differently
So, Why the same rule doesn’t apply for code written to define styles, javascript functionality across browsers?
Let me take an example from one of my recent project: As per requirements, we need to support IE (6,7,8), Forefox (3.x), Safari (3.x), Opera (9.x). The HTML mock-ups are generated by one of the creative agency who are in the market for good number of years and know their stuff. SO, just analysing the HTML mock-up, total HTML/CSS/JS size is around 1.9 MB (exclding images). Out of which the CSS/JS specifically for handling cross borwser issues is 0.06 MB which roughly forms 3.5% of the total code set. And such
percentage of cross browser hacking code is present on most of the website.
Below are some of the issues from different perspectives:
Development Perspective
- Analyse browsers which the site needs to support for previous web analytics or such tools
- Define graphics which could work across browsers
- Develop mock-ups with this extra code to hack site working across browsers
- Testing effort across browsers. Most of the times the UAT error log will have such issues in good percentages
- More development effort, hence more cost to the project
Maintenance Perspective
- If there is a new version release for a browser, regression test the whole site against the new version
- More maintenance effort and hence more cost
- Re-doing same stuff again and again and again
Users perspective
- Inconsistent behavious of the website across browsers
- More data download on users PC than actually required
- Slow response time as the data size is more than required
- Refresh issues with the release of new styles’Js etc.
Internet perspective:
- More storage space
- Larger network bandwidth
etc.
We are progressing at a fast pace in web development, talking of HTML 5, but we are still struggling to get the basics right.
Image if we could have standards defined for the browsers which ideally will allow us to write code once and no matter which browser you use, it will just work consistently across all of them. We spend almost 10-15% of the total project time, if not more, on such issues which actually is not project cost but the cost we are paying for not having standardization.