Hacker News new | comments | apply | show | ask | jobs | submit | roryokane's comments login

As a substitute, you can click on a comment’s timestamp and then bookmark the current URL, which will be a permalink to that comment.

-----


> Didn't know what a TIL was until just now.

You’re supposed to say “TIL what a TIL is” :-) .

-----


TIL how I should have said I learned what a TIL is :)

-----


The separate Issues problem could be worked around by disabling Issues on all repos, then creating a new “our-org/our-project-issues” repo that contains no code, but has Issues enabled.

-----


Direct link to the Tetris game’s source code: https://github.com/andrewrk/tetris/tree/master/src

-----


That sounds like a good reason to not use indentation – since Zig is so low-level, it is a good candidate for machine-generation. But I can’t think of a good reason for Zig to separate statements with semicolons instead of unescaped newlines. Zig-generators should be able to generate "\n" as easily as ";".

The only reason to keep semicolons I can think of is to look familiar to C programmers, so as not to scare them off. I’m not very familiar with that demographic, but I think most of them would be fine with it, especially if they have used other semicolon-less languages. Semicolons, which are present on about 50% of lines, add visual noise and the cognitive load of remembering to type them.

-----


Having semicolons introduces simple redundancy to the language. If you leave off semicolons you introduce more ambiguity, which can make error messages less clear since it's less obvious to the compiler exactly what was the mistake the programmer made.

Think of it like a sliding scale: on the far extreme of no redundancy, a typo could be a runtime error instead of a compile error. On the far extreme of redundancy, you have to express your code twice in different ways. Having semicolons is a reasonable balance between the extremes.

-----


I think I understand why semicolons make good error messages easier to implement. However, I don't see anything that makes that same quality of error messages impossible in a language without semicolons. It's just a matter of how much time the language writer is willing to spend on slightly improving the user experience.

Semicolons help get a better error message for the following typo, if `foo` can take either 0 or 1 arguments:

  if (true) {
    foo(;
    bar *= 2;
    baz(
      "first",
      "second",
    );
  }
The compiler can easily tell you that you forgot a ) on line 2. If semicolons were optional, the program would be this:

  if (true) {
    foo(
    bar *= 2
    baz(
      "first",
      "second",
    )
  }
The simplest error message to implement would complain that you forgot a ) somewhere within lines 2 to 7, and also that the argument to `foo` contains two statements instead of one expression. This error message would be less helpful.

However, with the semicolonless language, you could still write the compiler to give the better error message. You could have a heuristic that that this combination of errors suggests a different error, or you could parse indentation for error-checking purposes. It would just require more work on the part of the compiler writer.

-----


There's also the group of people I'm in: I _like_ the explicit semicolons.

-----


SPOILERS! Do not read the parent comment if you have not beaten the game.

-----


It does have that character. Press Option-Shift-8.

-----


The same Option key that isn't on the standard US layout either?

-----


Posted as a GitHub issue: https://github.com/nolanlawson/pokedex.org/issues/10

-----


I had the back button problem too. The solution is for the app to add routing, which is tracked in this issue: https://github.com/nolanlawson/pokedex.org/issues/2.

-----


The balance in someone’s checking account. A checking account is the bank account that written checks take money from, as opposed to a savings account.

-----

More

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: