Help:Extensions/Scribunto/Usage

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

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

The good

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

The bad

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

The ugly

 * TBD

Guidelines
Only use a module if absolutely needed.

Examples
Below are a couple of examples that would justify using a module.
 * 1) Complicated logic.
 * 2) Error avoidance.
 * 3) Large   statements.
 * 4) Multiple (possibly nested)  s.