Audio migration in progress. Some responses pages / audio files may have broken file links.


From Dota 2 Wiki
Jump to: navigation, search
For information on how to code in Lua look at the reference manual.
Illusory Orb icon.png
▶️ We are in accord.
This page has been marked for an open review.
Please see the discussion page for additional information, your opinion is welcome.

This page attempts to give some guidelines as to when modules should be used.


Modules are generally faster than templates. However, some considerations should be put into whether using one is worth it.

The good[edit]

See also: The Good
In 99% of cases, a module will perform better than an equivalent template.
Many things that can't be done in templates are possible in modules.
For logic based operations (e.g. Module:Calculate) and large templates the Lua code is much more readable than an equivalent template.

The bad[edit]

See also: The Bad
Editing modules requires some basic programming knowledge and knowledge of Lua. This makes them hard to change/update for many users.
Modules take away some of the simplicity that makes MediaWiki and the template system great.

The ugly[edit]

See also: The Ugly
  • TBD


Only use a module if absolutely needed.


Below are a couple of examples that would justify using a module.

  1. Complicated logic.
  2. Error avoidance.
  3. Large #switch statements.
  4. Multiple (possibly nested) #cargo_querys.