|
Boost : |
From: William E. Kempf (williamkempf_at_[hidden])
Date: 2002-09-09 15:20:36
From: "Rozental, Gennadiy" <Gennadiy_at_[hidden]>
> > > 2. Even with Javascript 1.5 it's pretty easy to write
> > "portable" code.
> >
> > That explains why you've got code to detect the browser in
> > your Javascript?
>
> How many ifdefs we have in our C++ code. Does it make it nonportable?
To some degree, yes. But this sort of portability is much more difficult to
do with Javascript. Browser detection usually relies on checking for some
behavior of the DOM and making assumptions from that, but these tests break
with new versions of browsers, and worse yet, often guess incorrectly in the
first place. I've seen the code that should do a reasonable job of
detecting the most popular browsers, and it's a very long and convoluted
piece of JS and has been found to be incorrect numerous times and been
updated.
In any event, the argument is apples to oranges. If you don't use JS,
there's no need for such tests and your documentation is automatically more
portable.
Bill Kempf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk