Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Are they not using attributes, which start with a #? I thought PHP had C style // comments.


They are attributes. PHP does also allow # as a comment character in addition to // style comments and I assume that's where the poster got confused.


You can call it an “attribute” and you can also call it a “comment that affects the code” - they’re both just labels for the same thing. If you don’t want the latter to be a legitimate label (and it is, because I’ve communicated that idea with those words and you’ve understood what I’m referring to immediately) then the solution is to use any other symbol other than those reserved for comments. Imagine if we just had something like const a = 2 * 3 *[pineapples] * 10 and pineapples was coloured in like a variable in your syntax highlighting and people were like oh yeah don’t worry about that, that’s just a comment in the middle of the arithmetic. It’s ludicrous.


Is this all because it uses the hash symbol? I mean, you could probably call anything a "comment that affects code" if we want to get abstract. Attributes are in a bunch of languages, but they aren't comments. Comparing them to comments just feels like you're ignoring the fact that they are code that affects runtime.




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

Search: