Thou shalt avoid global variables
2015-04-13
![images/thumbnail.jpg - Thumbnail](/en/2015/04/evitaras-variaveis-globais/images/thumbnail_hu3aedaec767ba2e72a9471511d3d863ed_6783_300x0_resize_q75_box.jpg)
The more global variables a program has, the most obscure it becomes. Please avoid them. This is a basic rule of good programming and should always be followed. Even if several variables have to be passed by parameter, it takes slightly more effort but yields a much more readable and safer code. Exceptions can be made for simple reports which run around a single internal table, which can be declared globally without compromising clarity.