in reply to strict, scope, my and foreach - not behaving as expected
I ran into some unexpected behaviour while adding 'use strict' to a working program.I highly doubt that adding 'use strict' lead to unexpected behaviour. From the description of the problem, it looks to me that you added a 'my' that caused to problem you experienced. 'my' and 'strict' are two different things. You can use lexical variables without having any strictness enforced (just like you can drive the speed limit even without the police nearby!), and you can have strictness enforced without having any lexical variable in your program.
But what I really wanted to ask is Why? What's the point of adding 'use strict' to a working program? 'use strict' is a development tool. A useful one, but starting to use it on a working program adds, uhm, nothing. OTOH, it might prevent your program from compiling, inviting you to modify the program, which might cause all kinds of bugs to creep in.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: strict, scope, my and foreach - not behaving as expected
by wolv (Pilgrim) on Jun 09, 2004 at 13:18 UTC | |
by Abigail-II (Bishop) on Jun 09, 2004 at 14:10 UTC | |
by cfreak (Chaplain) on Jun 09, 2004 at 15:06 UTC | |
by Abigail-II (Bishop) on Jun 09, 2004 at 16:58 UTC | |
by vek (Prior) on Jun 09, 2004 at 21:14 UTC | |
|