11 ms·
So does that string literal include the spaces between "/ * [space]" and "Hello", and "you?" and "[space] * /", or not? By the fact that you included spaces in
by SimHacker 15y ago
So does that string literal include the spaces between "/ * [space]" and "Hello", and "you?" and "[space] * /", or not?
By the fact that you included spaces in your example, does that imply it doesn't include the surrounding spaces in the string? Maybe your example implies that spaces are not included, but maybe they are or maybe they aren't, since comments don't require them, but usually have them and look ugly without them.
I think it's a bad idea to use C-style comments as multi line strings, because it's ambiguous and/or ugly because of the surrounding spaces. If the leading and trailing spaces are included in the string, then it looks "/ * [nospace] ugly [nospace] * /", and it drops the surrounding spaces like your example implies, then "/ * [nospace] what does it mean [space] * /" if you omit one or both spaces? Messy and ambiguous.
It looks like something the C++ committee would come up with when they ran out of punctuation characters, and decided to abuse existing syntax instead. Comment overloading, an extension of Generalized Overloading for C++2000: http://www2.research.att.com/~bs/whitespace98.pdf http://www2.research.att.com/~bs/whitespace98.pdf
[I can't format an example of what I mean literally and had to add extra spaces, because of hn's stupid formatting rule: "Text surrounded by asterisks is italicized, if the character after the first asterisk isn't whitespace."]
- nailer 15y agoSorry, I read the part about HN making it difficult to format your post, but I still don't quite get your point. I think it's pretty simple what was proposed: everything between the stars is included.