Here's a distilled set of programming guidelines which I have learnt myself and suggested to others, over the course of 20 years.
The main focus of these guidelines is to enhance readability. Sometimes, better readability might affect performance of the code for better / worse. In such cases, my suggestion is to compromise readibility only in the critical sections of the code.
The evils of globally scoped state (variables) have been well documented. This is an inductive extension of the same argument.
By limiting the scope of state we make it easier to read / analyse the system.