logoalt Hacker News

corps_and_codetoday at 5:02 PM1 replyview on HN

Maybe they mean rather than:

if (thingThatIsTrue):

  // a bunch of logic here...
else:

  // different logic here...

they mean:

if (thingThatIsTrue):

  return doThisWhenTrue()
return dothisWhenFalse()

Just a simple example. I'm not sure if this is what you consider "obfuscating" the branches. Logically the same, but a bit more linear to understand?

Edit: I am bad at formatting comments here.


Replies

tainktoday at 6:31 PM

Putting two spaces before the line formats is as code.

Example:

No space before start of line.

One space before start of line.

  Two spaces before start of line.
Thus, you can put multiple lines of code with indentation as well as long as you put two spaces at the start of the line:

int main() { return 0; }

  int main() {
    return 0;
  }
See https://news.ycombinator.com/formatdoc
show 1 reply