Board Thread:Watercooler/@comment-5590118-20150701035141/@comment-24473195-20150709083557

Cqm wrote: @Dessamator I disagree. All modules should either be accessible as a library (i.e. for use in other modules) and accept any arguments the method needs as dictated by the author(s), or through a template in which case the method accepts frame as it's only argument and the templates parameters are accessed through. There is no reason to use #invoke syntax directly on any page. I didn't mean that the invokes should be added to the pages/articles, but for testing purposes it would be nice if it handled both. If I have to use another author's templates, I'll first try to see if it works in a regular page, e.g. sandbox, before implementing it in a template.

The only way for someone who doesn't have a technical mind to test these templates is to go through the process of creating the template immediately. Unless they also have a sort of sandbox template.

There are various cases where frame is tested to see if it's being used from the console (or as a test), but those shouldn't be expected normal use cases. Well, I still believe that proper error handling should be implemented for cases where the module isn't supposed to be used directly. Consider this perfectly normal code:

Even within a template that is meant to be used by a page/article it will trigger an error. Worst still it will trigger an unintelligible error to anyone who doesn't understand lua modules. The only way to hide the error is proper error handling or using. That's something an average wiki editor might not know.

Personally, I'd assume that there is something wrong with the module, or I made a mistake if I didn't understand the lua code.