Statics are fine for singletons like a factory class or something, but i tend not to use them for variables at all -> There are always an entry point in every application!
When i find me in a situation when i pass too much parameters to a method i just use a "context pattern" and wrap this parameters into its own class/struct and pass this instead.
Example: UpdateGame(GameState *state) against UpdateGame(RenderState *renderState, MemoryState *Memory, InputState *state, ...)
But i use statics for method declarations all the time, because static has more meanings that just "global". Static in c++ can mean also "internal" - like "can be used in this unit only.
The first thing i do in C to declare a macros like this and use this instead of static directly (filtering is much easier this way):
#define internal_method static
#define global_variable static
#define local_persist static
Statics are also bad in other scenarios, like for example:
- Statics in a Server application (Except from factory instances) are bad when the scope/thread switches (Reloading a dll or something can cause this!)
- Multithreading/Parallel computation can go very wild with statics even with proper locking mechanism (GC decides to dispose static or something - will not happen in C...)
- Compiler may do nasty optimizations on static variables which may cause unforeseen consequences now or in the future