TIPS : Lua Scripting/Programing.

  • boxmein
    6th Apr 2013 Former Staff 0 Permalink
    Seriously though, over-commenting is never good unless you're writing raw assembly code. And even there are some extremely obvious parts one should not comment to.
    I honestly think one should create their own coding habits and sorts of 'conventions' they follow, just saying.
  • MiningMarsh
    6th Apr 2013 Member 0 Permalink

    On the spaces, (and this is completely opinion, so take it as a grain of sand), 4 has been standard per block when people have used spaces. But why not just use tabs? Then everyone can view it in their own editor with the spacing they find comfortable.

    inb4 “what about tables and such”,

     

    <tab> table key | table data

    <tab> ----------+------------

    <tab>      key   | 5

    etc.

     

    On the commenting, yeah, as others have said, that is a bit excessive. Though I am not one to talk, I have horrible commenting practices, I comment way to much.

     

    On the spacing in arguments, again, this is completely opinion, but I have seen this style much more, and it is a little more visually clean in my opinion:

     

    function(arg1, arg2, arg3)

     

    if((case1 operator thing2) operator ... caseN)

     

    (I know this may not be proper lua, but bear with me, its been a while since I have done lua code).