quote:
Originally posted by Amec
quote:
Originally posted by CookieRevised
I can read the program and I am 100% confident in knowing what it is going to do and that it is going to work correctly.
You and I might know that it's going to work correctly, but what happens when someone new to ECMAScript copy+pastes your code? They're not going to know all the caveats that go with using with(). What if they want to edit it?
Sure, but that's the exact reason why I posted that code, it doesn't need to be edited anymore (in most cases). The previous code had quite a few things people needed to edit in order to let it work properly in their scripts and it even contained potential bugs.
Either way, you can say the same thing for like 75% of code in any snippet. If you're new to scripting you shouldn't start editing without knowing what you're doing. That goes for
with() usage but that goes for most other statements and methods too from the simpliest to the hardest to understand.
EDIT:
quote:
Originally posted by Amec
Edit: I just realised that the script is with'ing on a DataBloc interface, which always has the same members, and hence there's no ambiguity. lol
still... you do have a small point when it wasn't though. But so do I, I like to believe (one shouldn't use statements nor edit stuff you don't know... and of course... testing is key).