I am writing my own programming language and am reconsidering many aspects of my syntax right now. Something that bothers me in many most languages is the trailing apostrophe in character literals.
Example
With trailing slash: 'n'
Without trailing slash: 'n
Why do new languages (like rust f.e.) keep using a trailing apostrophe?
Seeing such languages fixing issues we had with old languages (ok, the trailing apostophe is not really an issue) leaves me thinking that there must be a benefit to keeping the trailing apostrophe. I'd agree to keep it if it supports readability, but I don't think it does.
Here are some more exotic examples:
'\n
vs'\n'
'\r
vs'\r'
'\t
vs'\t'
'\\
vs'\\'
'\'
vs'\''
'\"
vs'\"'
Do we keep this syntax due to historical reasons or is there more to it that I don't yet understand?
Note that the trailing quotation mark in a string literal is necessary.