For the project I'm working on, I need a global variable (technically I donβt do this, I could create it and then pass it to each function call, and let every function call know about it, but it just seems like a hack, less readable and working.)
Global variables are lookup tables (endgame, open book and transposition / cache) for the game.
The fact that some code may lose some of its unresponsive behavior is actually a point (acceleration), yes, I know that the global volatile state is bad, it really stands in this case (10x + performance improvement)
So here is the question: "build a singleton or use a static value in a static class with combinators"
They are virtually identical, but I'm curious what people did before on this issue.
Or, alternatively, should I pass things on to everyone (or at least link to it anyway), is this really the best answer?
Snark source share