TIP: title your scripts - easier debugging

Post Reply
Caled
Posts: 403
Joined: Thu Apr 09, 2009 4:45 am

TIP: title your scripts - easier debugging

Post by Caled »

Just a little tip, because in all the scripts I've used from other people, I don't think I have ever seen anyone do this:

To help with debugging in Mudlet, when you create a new script object, make the first line a comment with a title, either the function name, or a name for a group of functions if there are multiple:

-- timer-backbone
namespace = namespace or {}
function namespace.startTimer(s)
end
function namespace.etcTimer()
end

In this way, the debug window output will use your comment as the script title (it chooses the first line, which is often just something like "namespace = namespace or {}" and doesn't help at all in figuring out WHICH script has a bug on line 52

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: TIP: title your scripts - easier debugging

Post by Vadi »

Yep, this helps tons.

Post Reply