Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Better to develop cross-browser code up front or develop for one browser and go back and make it work in the others later?

I'm looking for feedback on peoples experiences with developing sites that work across browsers. It seems to me there are at least two obvious ways to approach the task of making your site/webapp work across browser:

  1. Constantly test across all supported browsers every step of the way; or
  2. Pick a browser, get everything working in it as a reference implementation and then make all the other browsers match the reference implementation.

Each approach has an obvious drawback -- the problem with #1 is that you end up doing a lot of unnecessary work -- especially if you are developing a webapp that is going through a lot of iterations/prototyping/spikes etc. You will make a bunch of stuff work across browsers that will subsequently be discarded/removed.

The disadvantage to approach #2 is that while it makes the initial development much quicker and more painful it makes it much harder to figure out where some of the specific errors arose, especially for more complex issues -- whereas if you had been developing for all browsers at once you should catch it right away and know what change(s) introduced the problems.

A somewhat obvious third option would be a hybrid approach, but it seems to me that you would end up losing more by experiencing both of the problems with #1 and #2 than you would gain from the benefits of doing both.

What have you found to be the most effective way(s) to approach this challenge?

like image 741
John Avatar asked Oct 23 '08 22:10

John


3 Answers

I’ve found that if you get too deep into developing a website without looking at other browsers you’ll quickly get to a place that is too much of a headache to debug. I consistently open my web pages in all the browsers I care about.

I strongly suggest you verify all browsers each time you make a large change to the site.

like image 55
Joe Basirico Avatar answered Oct 06 '22 00:10

Joe Basirico


Make it work with all browsers up front. This will mean extra testing during development but will cause you less pain later. I find it's usually easier to diagnose problems if I've just developed the thing, rather than coming back later and trying to figure it out...along with a list of other issues.

like image 31
Ty. Avatar answered Oct 06 '22 01:10

Ty.


It partly depends on whether you know it's going to have to work in all browsers up front. If you do, then you really are better off just making it cross-browser to begin with. You don't need to test that everything is 100% compliant every step of the way, but you should code toward that.

And really, it's not that hard, especially what with JS frameworks like jQuery and Dojo around that take care of the scutwork. If you find yourself continually battling one browser or another, you might want to reconsider your design, as you may have chosen to do things in a way that is inherently more difficult to do when cross-browser compatibility is important.

like image 25
dirtside Avatar answered Oct 06 '22 01:10

dirtside