lua-users home
lua-l archive

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


On 27/07/2011 10.42, HyperHacker wrote:
[...]

I don't use Vim, but I use a fairly simple method to make it clear
which 'end' corresponds to what when there are several:
if foo then
   while bar then
     something = function(...)
       doThings(...)
     end --function
   end --while bar
end --if foo

A lot of things people suggest "to make the code more readable" can be
implemented with just good comments.


Very true indeed!

I also follow that practice of "tagging" end with comments.
It has only a drawback: whenever you refactor complex code you must be careful to check the tags, such in case they got out of sync with the matching statement opening. A bad comment is often worse than no comment.

-- Lorenzo