This can be a very crucial topic to discuss when it comes to first-time coders in Julia. As we already know, Julia is quick and fast, but its speed can easily be hampered if the underlying code is badly written or it's inspired by paradigms of some other language like Python.
As per the official website, there can be a number of things we can do as a Julia programmer to enhance the performance of the overall code. We will now discuss them one by one.
The use of global variables in a wrong way can certainly put brakes on the performance. A global variable has a value and a data type associated with it, which can change over time, thus making it difficult for the compiler to actually optimize the code. As good practice, the contents should always be declared in the following manner:
julia> const A_CONSTANT = 10
10
Whenever possible, variables should be passed as arguments to functions in the code.