All those "Globals are bad" are overly biassed. Why do we need to bounce around a single object that is gonna be modiffied in a diferent portion or way on each different screen having to create inputs and outputs all around?
React / Redux does it with stores. The only bad practice i see here is judgin everything as bad without considering the full context. Each project is different, and just cause a situation requires it, it doesnt mean the code is gonna be plagued with globals.
And not all the data is suitable to be stored on local or db storages. In memory should be an option.
Roberto Aguilar wrote:
Well. There is no "absolute truth", they say, but "global variables are BAD" is very close to one.I'm a little lazy this morning (bad night), so I'll just put here a link with plenty of nice answers why "global variables are BAD".
https://softwareengineering.stackexchange.com/questions/148108/why-is-global-state-so-evil
And yes, they are ALWAYS bad. The context do not matter. The thing is that sometimes, in real world, due lots of different possible constraints, you can't avoid it.
And still, we use them. A Session Variable is a "global variable". A Site Property is also a "global variable".
This doesn't make them "good".
Cheers,Eduardo Jauch
Thanks for your Reply Eduardo, and i totally agree with you, but to fully gain knowledge, we need to understand the darkest paths too. Not just the fancy and shinny drag and drop.
How can someone master anything if living in the ignorance and just following the paths others dictate? The success or failure of my application will be entirely up to my wits.
By the way i figured out what i was looking for in the documentation: Extend your mobile app using javascript.
er, discussion on a thread of 2013...
J. wrote:
Indeed, I already sent the necromancer a PM for this.