Hacker News new | past | comments | ask | show | jobs | submit login

If you used leading whitespace you could wind up with something like old basics where you had to number your lines. It was great, you'd always skip 10 between lines so if you had a bug you could stuff a patch in between existing lines at *5.

For the whitespace, you'd have to know how deeply to indent the outermost part of your code.

So if you add an if block to a for loop, every line of the code has to be indented and only the contents of the new if would be at indent of 0.

I am not going to write this pseudocode in AntiLang because I am not that much of a masochist.

    for ( foo in somearray )
  doStuff(foo)
    end
becomes

      for ( foo in somearray )
    if ( condition )
  doStuff(foo)
    end
      end
If you antilanged this the rest of the way, you could have a common `start` to indicate the start of a block and then replace the `end with the actual conditional.

    start
  doStuff(foo)
    for( foo in somearray )

This gets horrible pretty quick. So as terrible as trailing line space is, leading line space is quite possibly worse.

Which leads me to the ultimate conlusion -

  White space should be balanced.  If you need 4 spaces indent, you also need 4 spaces on the end of the string.





This is some of the evilest idea I got on the post...

Raised issue for it - https://github.com/SirusCodes/AntiLang/issues/9




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: