Using modules
So far, we have learned a lot about programming. First, we learned that programming is all about data. Then, we learned about many ways to optimize our code, such as using variables, conditionals, functions, tables, and even loops. All of these ensure we can write our code more efficiently without copying the same thing repeatedly.
There is one small optimization left for us to cover. The items we previously listed are all optimizations within the same script. Sometimes, we want systems to use another system. So, how do we transfer one particular script’s data to another script?
In the following sections, we will learn how to use modules. Modules are their own “script” but can be required in another script. This way, things that the module knows can be used in your other script. What you just read probably sounds complex, so let us continue our student system to explain all of this in more detail.
Creating a module script
First, we need...