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 7th August 2003 23:12

> ========================
> Wednesday 6th August 2003 17:30:47
> RE: FN-FORUM: JavaScript help.... - Ross Hamilton [EMAIL REMOVED]
> 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!

I'm with Ross. You're storing intermediate values, which in my view
often makes life easier for the programmer (the computer can work it out
and, in compiled languages at least, will tend to produce the same
optimised code each way). Of course you have to be careful with
lifecycles and state changes, etc. (but browsers are unlikely to change
their type in mid-request!)

Of course, the *proper* way to do things would be to have a method:
function IsIE4() { return !navigator && version==4 }

But if you understand it, your computer can understand it and it does
what you expect, then it's probably good enough for websites!

One of the irritating things about SQL is that it doesn't take kindly to
this sort of thinking, and you have to be logically correct when
designing databases and writing queries.

Just my NZD0.03,
Richard




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