lua-users home
lua-l archive

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

On 09-May-18 21:18, Lorenzo Donati wrote:
I often comment the end of scopes that span over about 15-20 lines, especially when there are multiple nested scopes. For example

if ....
   for ...
    -- blah
   end -- for

   function MyFunc(....)
    -- more blah
   end -- function MyFunc
end -- if

You get the gist of it.
It helps a lot when debugging or refactoring code.

I do the same (in any language), even if I usually prefer to comment about what the function/block/loop actually did, rather than refer to its opening instruction, e.g.:

  -- scan goblin list for culprit
  for g in ipairs(goblins) do
  end -- (goblin list scan)

And I too find reverse keywords confusing, I have to disentangle my neurons afterwards.