Questions regarding single-script architecture & module loaders

Yeah @colbert2677 covered it pretty well. The short of it is that initialization sequences are utilized to “set up” whatever the module needs.

Analogy: Think of a firefighter. When a fire occurs, the firefighter “initializes” by putting on all of his/her gear and getting into the truck. Only at that step is the firefighter ready to fight fires. If the firefighter tries to fight fires before fully getting ready, there’s gonna be some trouble.

So in a similar light, modules that talk with each other need to make sure that they’re ready to talk with each other.

In my framework, there’s a separate lifecycle step called “Start” which is used after everything has guaranteed to have been initialized.

6 Likes

Looking down this thread I think everyone else has shown it very well & much better than I would.

Thank you for that explanation, it cleared up things.

Your input was also helpful, it’s good to see different opinions and implementations. Posts in this thread including yours taught me a lot and helped me better visualize things, so I thank everyone who replied.

1 Like