lua-users home
lua-l archive

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

Op 30 januari 2012 09:40 schreef Patrick Rapin <> het volgende:

IMHO, Lua does not encourage good commenting, because the language is
already quite clean.

Lua has no need of tautological comments, true.   Except if the recurrent baying for syntax like `x+=++y` eventually succeeds, which is unlikely. 

But if you like to comment properly, i.e. to explain the strategy rather than the tactics of your code, then Lua is helpful.

-- A standard construction for a comment that can start after code and goes to the end of the line.
An easy construction for a comment that spans many lines and can contain arbitrary characters.

Also useful for temporarily disabling code.
---[[ An optimally quick way to enable the code again.

-- Lua's support for literate programming tools is nonexistent (no line pragmas) and therefore you have no option but to use comments.  :-Q