The do is to introduce a new scope during an assignemnt. "not work for me" is rather vague - you want to elaborate, possibly with the actual error message?
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?