I know that global variables are bad and should be avoided as far as possible. However, when writing parallel programs with MPI for example, some variables only get initialised once, and never changed (This task's number, total number of tasks etc.). Is it still considered bad practice to have these variables as global? Since you pretty much need access to these variables all the time, it seems silly to make a class for them in main, and pass a pointer to it to 99% of all the functions in the program. My approach so far has been to hide them in a namespace mpi_glob (for the case of C++, I guess I would not bother to put them in a struct in C to emulate a namespace). I guess the question also goes for other set-only-once variables such as a system of units etc.