Putting a backslash after a part of the statement basically means ignore any newlines between this and the next characters so you can indent it however you want

  • astrsk
    link
    fedilink
    112 days ago

    This is one of the reasons why I don’t like gdscript. I get that it’s based on python and interpreted but I will never enjoy alignment sensitive languages. Just let me format it how I want and control EOL with semicolons.

    On a related note, might be cool to see some tips on the mono side of things here :)

    • GreyBeard
      link
      fedilink
      41 day ago

      Of course it’s a matter of personal preference, but I’m exactly the opposite. I’m ending a line by hitting the enter key, why should I have to go through the trouble of hitting the ; key for every single line, when more often than not I’m not breaking single lines up to multi-line. On those rarer occasions I can use \ key. It probably helps that I was “raised” on a white space sensitive language. But to me, it makes way more sense to let the whitespace mean the same thing to the computer that it does to me.

      All of that said, I’m still wrapping my if statements in () though. I don’t care if is not required. Just looks better to me.

  • Mikelius
    link
    fedilink
    11 day ago

    I tend to us the backslash syntax for longer if statements. One thing I do differently than documention mentions though is double tab the following lines in my if statements. Keeps it easier to read where it ends and where the actual code block begins.