Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleEnvironmental variables

Environment Variables are good for dealing with properties which need to be defined across the server. They are stored locally in your working directory Environment Variables Configuration File.

...

Expand
title1) Avoid harcoding

It is best to avoid hardcoding values! Instead, parameterize any values that can change.

In the Translator, you want to see as little text as possible.

Good values to parameterize are values like URLs, file paths, database names, etc.

Image RemovedImage Added
Expand
title2) Centralize your configurations

What you want to avoid is having configurations scattered all over your code - this makes it difficult to support and see what is configurable.

We recommend that you capture your configurations in the main.lua module only, and then pass your configurations to your functions. This has a side effect of making your functions more portable - if you need to call a function anywhere.

For example with configurations stored in custom fields, you can just pass the table of Configs into the function directly.

...