On Sat, 2011-01-15 at 17:38 -0800, Ryan Grove wrote:
> If another developer comes along and adds some code after the second
> var statement but before the second loop that assumes that i and/or
> thing are undefined

The chances that someone *wants* to use an undefined variable, and
consequently receive a ReferenceError, seem negligible.

Locality-of-declaration-to-use is a win for practical maintainability.

Var-at-the-top-of-the-function is a win for some kind of theoretical
purity, that will bite you (not just your inexperienced team-mates) when
you start moving code about.

-- 
And Clover
mailto:[email protected] http://www.doxdesk.com
skype:uknrbobince gtalk:[email protected]


-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to