Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

RE: FN-FORUM: JavaScript help....

date posted 6th August 2003 17:30

Dom wrote:
> If you're using Booleans and they're not independent, your analysis
> is broken. Take two variables, A & B. If for instance A is always
> true when B is true, you've encoded a four-state system, when there
> are only three states. If A cannot be true when B is true, the same.
>
> In this case, there's a 64 state system (six Booleans) to encode a
> three state system (the bit that switches docObj and styleObj three
> ways - IE4, NS4, none of the above).
>
> At first sight this seems rather perverse, hence my question, why
> Booleans?
>
> In fact, why not just use the provided appName and appVersion to do
> what you want? I.e.
>
> // pseudo-code
> switch name
> case navigator
> if version >=4
> do stuff
> else if version >3
> do other stuff
> case Eskimo

This prevents you from doing stuff like:

if ie4 do stuff

If we stuck to your suggestion we'd have to do something like this instead:

if !navigator && version == 4 do stuff

I know which I'd prefer. So what if you're declaring more variables than
you strictly need? It's not as if your computer is going to have trouble
keeping track of six variables instead of two!

You've also got a more extensible model - the one you suggested breaks down
if you want to distinguish between three different browser types.

--
[EMAIL REMOVED]
DJSE Limited, Willow End, Mawthorpe, Alford, Lincolnshire, LN13 9LT
T: 01507 466 797
F: 01507 463 731
M: 07970 801 661
http://www.djse.com
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 04/08/2003



Messages by Day
August 31st 2003
August 30th 2003
August 29th 2003
August 28th 2003
August 27th 2003
August 26th 2003
August 25th 2003
August 24th 2003
August 23rd 2003
August 22nd 2003
August 21st 2003
August 20th 2003
August 19th 2003
August 18th 2003
August 17th 2003
August 16th 2003
August 15th 2003
August 14th 2003
August 13th 2003
August 12th 2003
August 11th 2003
August 10th 2003
August 9th 2003
August 8th 2003
August 7th 2003
August 6th 2003
August 5th 2003
August 4th 2003
August 3rd 2003
August 2nd 2003
August 1st 2003


Messages by Month
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003


Messages by Year
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000