lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

About the -- comments, a subtle annoyance is that the standard diff tool
(with common -u option) uses '-' to mark deleted lines, so deleted Lua
comments are hard to catch.  Since Lua ended up supporting # on the first
line anyway, I sometimes wish it just used # completely instead of --.

About disabling code blocks, depending on the situation I use "if nil then
... end" or an editor macro like Nick describes.  I think the fact that code
inside "if nil then ... end" gets parsed is useful.  For the same reason I
use "if (false) {}" in C++ instead of "#if 0 ... #endif" whenever possible.
The reason is that code not parsed gets stale.  Just because you chose not
to execute some code doesn't mean it should no longer be maintained.  It
would be nice if Lua didn't generate bytecode for such blocks however.