At the moment I do not understand the difference between global
and const
used at the global scale. I understand that there can be global
variables that change while const
variables do not, and that I should not use global variables, but then const
is defined as used to declare global variables whose values will not change. In almost all code (and particularly performance sensitive code) global variables should be declared constant in this way.
Does this mean I should try to avoid all const
in the global scope? Would that not make more work for Julia if I am reusing the same constants within different functions?