This would be useful when you want to use a descriptive variable name such as in my project, length_of_data_in_the_last_31_bytes_of_a_blob_without_consecutive_final_zeros, and have multiple indentations, and want to limit the character width to 100. Without such a use like a forward slash to break long variable names over multiple lines, the alternatives are to use shorter variable names, or to let long variable names be an exception to the 100 character wide limit.
I can’t even be certain that that is an intended use case of the C “feature”. It simply falls out from the fact that the C preprocessor performs a simple text-to-text transform.
I can’t imagine what the use case for such long names is? By which I mean, you might as well just write a comment at that point…
(people may counter-argue that comments can lie, but guess what? So can variable names!)
[OT] The character \ is a backslash, while / is a (forward) slash.
Re ultra-long identifiers, IME they’re cumbersome, even with autocompletion and similar aids, and I agree with @ExpHP that they’re no better than comments. In some forms of macro-generated code they can’t be avoided, but in that case they wouldn’t be visible to the user.
Personally I view names longer than e.g. 30 chars as an anti-pattern. Why?
The way I often view bindings is as a name for something else.
But if this is the case, then it follows that I need to remember that name, and be able to recall it quickly from working memory.
From this then, it follows that names too long to remember and recall like that miss their point.
At that point, you might as well petition for string literal identifiers.
$"hark gentle reader for this is the number of characters \
(defined as single grapheme clusters, including ZWJ-joined \
groups) contained within the most excellent variable \
`my_string`, excluding those which fall within the 'Arabic' \
classification" += 1;
At that point you should probably pick a shorter variable name. This one is so long it's not any "descriptive", it's just annoying and downright hard to read.
(If this were a satirical proposal, I would joke that you should refactor your variable name into a function, but unfortunately I'm quite certain it isn't.)
Yes, but I don’t believe changing identifier semantics is the right way to go about that.
Rather, it should be on the side of error reporting where names like that are pretty-printed.
How would the act of breaking up into lines something that the programmer writes in the source help with output that is formatted by the compiler? It’s already possible for the compiler to break lines in error messages if necessary, not to mention that types are usually paths, meaning that they can already be separated by whitespace, including newlines, in source as well as error messages.
Yes, that is a true statement. Or at least one I agree with. However, I still don’t see any connection between it and the proposed feature. How would one’s ability to place line breaks at arbitrary places in the source affect the compiler’s (already-existing) ability to format error messages (and maybe leave out pieces of types if necessary)?