Zireael wrote:Speaking of tips and tricks, the debugger (at least the LOVE one) has a nasty side-effect of a giant slowdown.
It took me roughly half an hour of googling (note: googling, looking at the site failed to point me to the correct page) to learn about require("mobdebug").off and .on
The warning about a possible slowdown and the tip for selective debugging should be up there easily findable and not buried in a debugging article for some language I don't even know about.
One more thought about debugging in ZBS: For me i distinguish between "debugging-lite" and "full-debugging"
-- full debugging: pro: i can do single step debugging. cons: VERY slow. ... but sometimes nessesary
-- debugging-lite: I run my love app as without debugging and use print() to send some information to the zbs output window. It is fast and the printed informations helped in most cases to find the bug. IMPORTANT: you should place the following line in a apropriate place in your code, eg. in love.load()
Code: Select all
io.stdout:setvbuf("no"); -- send printed text without delay to the console.
Also a nicer print function helps a lot:
Code: Select all
local function dprint(str, ...)
print(str:format(...));
end;
dprint("x=%s, y=%s", x, y) -- example call
This lite debugging mode already saved a lot of my time