|
|
 |
Re: FN-FORUM: JavaScript help....
date posted 6th August 2003 18:23
On Wednesday 06 Aug 2003 5:57 pm, Ross Hamilton wrote:
> > // pseudo-code
> > switch name
> > case navigator
> > if version >=3D4
> > do stuff
> > else if version >3
> > do other stuff
> > case Eskimo
>
> This prevents you from doing stuff like:
>
> =09if ie4 do stuff
Nah, cos one of the things you can do in "do stuff" is "navVersion=3DIE4"=
;
and then use navVersion wherever you want. =20
> If we stuck to your suggestion we'd have to do something like this inst=
ead:
>
> =09if !navigator && version =3D=3D 4 do stuff
>
> I know which I'd prefer. So what if you're declaring more variables th=
an
> you strictly need? It's not as if your computer is going to have troub=
le
> keeping track of six variables instead of two!
It's not the computer, it's the programmer.
> You've also got a more extensible model - the one you suggested breaks =
down
> if you want to distinguish between three different browser types.
Err, no.
--=20
Dom Latter.
|
 |
|