Skip to main content

Questions tagged [globals]

Filter by
Sorted by
Tagged with
1 vote
4 answers
454 views

I'm developing a library in JavaScript (TypeScript, actually) which is split into several modules. It's meant to run both on the web and in non-web environments like Node.js. The library is meant to ...
Blue Nebula's user avatar
0 votes
2 answers
395 views

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 ...
PythoonNoob9000's user avatar
6 votes
9 answers
818 views

According to Why is Global State so Evil?, I know there are already many answers about why is "global states" bad. However, I'm not raising new reasons to oppose that. Instead, the currently ...
wcminipgasker2023's user avatar
18 votes
11 answers
6k views

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 ...
wcminipgasker2023's user avatar
12 votes
5 answers
4k views

According to https://softwareengineering.stackexchange.com/a/200092, as I know, "preserve whole object" is a refactor method that passes the whole object instead of required parameters only, ...
wcminipgasker2023's user avatar
0 votes
1 answer
610 views

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 ...
procrastinator1771's user avatar
0 votes
3 answers
335 views

I'm wondering if it's bad practice to have a variable in a webserver which counts the amount of incoming requests and put it in an environment variable. In C# for example you have System.Configuration....
Vincent's user avatar
  • 383
2 votes
7 answers
517 views

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://...
wcminipgasker2023's user avatar
0 votes
3 answers
433 views

As far as I know, coupling is about counting number of other classes in a class, so for the following program that emulates a UI program that shows "WelcomePage" at start and also pops a ...
wcminipgasker2023's user avatar
2 votes
4 answers
946 views

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 ...
wcminipgasker2023's user avatar
26 votes
5 answers
9k views

Over and over again we're told, "globals are bad" and with good reason. However, I'm working with a logger that needs to be accessible everywhere in the program. Why shouldn't I create a ...
StaticMethod's user avatar
1 vote
4 answers
878 views

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 ...
Sam's user avatar
  • 31
1 vote
3 answers
567 views

According to Why is Global State so Evil?, I believe we should avoid global state, so suppose I have an App that count user clicks in all pages like it: public class GlobalState{ public int ...
wcminipgasker2023's user avatar
12 votes
4 answers
3k views

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 ...
glades's user avatar
  • 493
3 votes
2 answers
497 views

I have read many blogs and stack exchange posts about global state (usually) being bad practice. I'm now trying to avoid this where possible in my code, but I'm running into a case where I don't know ...
PieterV's user avatar
  • 233

15 30 50 per page
1
2 3 4 5 6