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

1. It doesn't look like a comment, so it's less confusing to people new to the language

2. It allows the programmer to skip comments entirely, when reasoning about program behaviour

3. You can write comments without fear of the comment changing program behaviour (probably of little concern in practice, but still)

Putting directives in comments is always a hack. C and C++ get this right, with #pragma.




You also get no completion help from the language server since you are in a damn comment


That's another good point.


These don’t seem like remotely significant issues, especially given how infrequent these directives are.


> 3. You can write comments without fear of the comment changing program behaviour (probably of little concern in practice, but still)

There's historical exceptions, but the new rule is this:

Comments begin with "// ", pragmas don't have that space.


Can you not see how that just amplifies the potential for confusion and bugs?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: