Junior dev: What's the best prefix for global variables?
Senior dev: //
@fribbledom Reminds me of a "senior" engineer at a previous employer who used a static variable to store state in a web application. Unsurprisingly, I left a month after that gem.
There once was a master programmer who wrote unstructured programs. A novice programmer, seeking to imitate him, also began to write unstructured programs. When the novice asked the master to evaluate his progress, the master criticized him for writing unstructured programs, saying, ``What is appropriate for the master is not appropriate for the novice. You must understand the Tao before transcending structure.''
@fribbledom Obviously you put it in a singleton, and just inject that singleton through Inversion of Control so the global state is no longer in global variables and it isn't a problem.
...that was painful to type...
@fribbledom if it ain’t broke, don’t fix it.
If it solves the problem and doesn’t introduce an overage of foreseeable debt, don’t knock it till you try it.
If you you’re worried about undefined behavior, then define the behavior you’re worried about.
Server run by the main developers of the project It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!