Of course I "just do this" too because B4X really gives me no alternative. But it's a long way from ideal, either for clarity or for efficiency of coding, testing, and maintenance, for any but the most simple of modules. To have modules that potentially contain thousands of lines of code and dozens of subs, having fundamentally local variables all containerized in the Global section in order to get the capability of persistence, is just bad practice. Full stop. (You could work around it somewhat by having very small modules, but that results in tons of modules which is also inefficient and a hindrance to clarity).I don't see the point of this. I would just use appropriately named Global variables.
Fifty years ago people couldn't see the point of loop structures when you could simply use GOTO.
The latter leads to spaghetti code. The former leads to spaghetti data.
Okay, now I'm hungry.
Last edited: