Gerrit Beukema wrote:
Best practice is to define all your variables at the top of your code.
No it's not.
It's actually safer to declare just before use. It's also helpful when remodularising code to have the declarations with the code that uses, and semantically it's clearer. In any case, with inline data declarations such as
DATA(val) = ....
such a standard becomes meaningless.