4 ms·
If it ended up in the binary it probably wasn't a comment, in the true sense. Was that the name of the mutex?
by bmm6o 4y ago
If it ended up in the binary it probably wasn't a comment, in the true sense. Was that the name of the mutex?
- IncRnd 4y ago> If it ended up in the binary it probably wasn't a comment, in the true sense. I think you meant "in the source code sense" not "in the true sense." It could very well be a comment in installware.
- mkj 4y agoSeems likely this might have been the text message of an assert()ion if something went wrong with that named mutex?
- derefr 4y ago> If it ended up in the binary it probably wasn't a comment, in the true sense. In some languages, rather than comments being a special syntactic thing, you just write a string-literal expression as its own statement. Before dead code elimination was a thing, I imagine these string-literals would end up in the binary.
- schoen 4y agoI just checked, and this method is still syntactically valid (though not recommended style) in... C Javascript (Node) Python Perl Ruby Rust The strings did end up in my Python 2.7 .pyc bytecode, though not in my C or Rust binaries. My intuition was that this would work in most of these languages, but not all. For example, I thought Rust would probably complain about a value being unused. There's no such thing in general as an expression as a complete command in shell scripting, but there is a silly way to write comments as : comment instead of the normal # comment where : is a shell builtin equivalent of the "true" program, and anything otherwise syntactically valid on the line after it will be treated as command-line arguments to that builtin.
- skykooler 4y agoTechnically multiline strings in Python are the recommended style for multiline comments (e.g. docstrings).
- deleted 4y ago[deleted]
- Kwpolska 4y agoThey are recommended for docstrings, but not for comments in general. The compiler has a special case if the first statement of a function/class/module is a string (doesn’t have to be multiline), and it puts that string in the __doc__ attribute of that function/class/module — those are docstrings, and they need to be something visible to the compiler.
- tialaramex 4y ago