Most languages have rules for identifiers similar to the following:
- Must start with a letter or underscore
- All characters after the first can be a letter, number, or underscore
Many languages add additional allowed characters to this. JavaScript allows $
at the start or otherwise, and Haskell allows '
anywhere after the first character, as two examples. Some languages, such as Scala, allow identifiers to be wrapped in something like a backtick, and include any characters, even spaces: `string to output`
, for example.
What are the pros and cons for more permissive identifier rules?
$
? $\endgroup$