JS Tip #1: Pick your Battles, I mean, your Browsers
By Marcelo
With the all Web 2.0 meme, the use of JavaScript on the client has exploded. I first learnt it circa 1999, and back then, using IE 5 you could get a lot of cool stuff done with MSXML invoked through ActiveX. It took 6 years for another browser to come up with an equivalent technology (XmlHttpRequest) and allow the anti-Microsoft crowd to finally get some decent technology to develop for.
However, despite all the evolution in the browser (Firefox only, IE is stagnant), the tools to develop DHTML/JavaScript have not evolved that much. Where is the JS Profilers? Code coverage tools? Decent debuggers?
I've been doing intensive development for Sampa on the last 16 months, and gathered a lot of good tips to share with other developers. I will start a weekly post about JavaScript tips focused on “Web 2.0” views of web-development. Topics will range from cross-browser compatibilities to performance, from AJAX to AJAH, from hacks to known bugs/issues. I hope you enjoy this series, and case you have some good tip, send it my way and I’ll co-publish (you get the credit).
Tip #1 - Pick your Battles, I mean, your Browsers
Most of the time you see developers that are on either side of the spectrum: Either they say they only care for Firefox 1.5 (or IE 6, anyone?) or they say their code must be compatible with all browsers in the market, including, but not limited to IE 3-7, Firefox 0.8-2.0, Opera 6-9, Safari 9-10, Netscape 4-9, and all the mobile browsers.
If you are serious about creating a Web company, you can't be on either side of this fight. You have to pick the most popular browsers used by *your* user base (at least to who you think will be your user base).
As much as Mac fans don't like to hear it, a mainstream product must support IE 6. It also must support Firefox 1.0+ because this is the most popular alternative (and the favorite of the Web 2.0 crowd). After those two, each browser that you add to your list of fully compatible will have a tremendous cost in development and time to market. If you are going to pick a third browser, make it Safari, but not Opera (market share says it all).
A stupid thing being done by some companies is the release of an IE6-only or a Firefox-only version. They say they will release the other version later. If you do that, you risk finding out that what you wanted to do is impossible on the other browser.
I also have a pretty tough standing in regards to yet-to-be-released browsers. I don’t develop for them. Period. I won’t install IE7 until MSFT officially releases it (maybe I’ll install RC0); same thing for Firefox 2.0 or 3.0. It is just a waste of your time since these browsers have too many bugs, their behavior will change, and you’ll be spending precious time debugging issues instead of focusing on improving the quality of the product where it really matters.