Questions tagged [globals]
The globals tag has no summary.
88 questions
0 votes
2 answers
376 views
Global State, How To Do IT?
im kind of a newbie so take me easy i face a problem every time i make a project specially Client projects, which is Global State i always struggle to do it for example, here is the structure of one ...
18 votes
11 answers
6k views
Why is global state hard to test? Doesn't setting the global state at the beginning of each test solve the problem?
According to Why is Global State so Evil?, I know one of the disadvantages of "global state" is that it makes code "harder to test". I do not disagree with this, but what I don't ...
0 votes
1 answer
587 views
Global Variables State Management
Background: I am working in a Java environment using Spring Boot, where I often encounter scenarios where global variable state management is critical, especially within singleton services. I have ...
2 votes
7 answers
477 views
Why does "a consistent, understandable interface" differentiates database from global states?
According to some answers of How are globals any different from a database? that explains how database is different from global state: https://softwareengineering.stackexchange.com/a/319389 https://...
2 votes
4 answers
931 views
Why blaming "global state", instead of my user requirements, makes program state unpredictable?
According to Why is Global State so Evil?, I know I should not allow the existence of global state, one of the reasons is so called "it makes program state unpredictable". However, I'm not ...
1 vote
4 answers
845 views
Passing arrays as global variables instead of pointers in C
I'm required to write the Low-Level Requirements of a Software Component which shall perform signal processing over arrays of 200k elements of integers/floats which lives in the main memory of the ...
12 votes
4 answers
3k views
How to initialize the same global resources from multiple modules independently?
I encountered the following situation: I have two modules, TokenService and Wifi which are initialized from main(). The modules themselves don't know of the existence of each other and function ...
1 vote
2 answers
524 views
Using class attributes as globals in Python - is there a catch?
I have found myself in the habit of using code like this. class glb: "just for holding globals" args = None # from argparse conf = None # from configparser def main(): ......