←back to thread

650 points Stratoscope | 1 comments | | HN request time: 0.387s | source
Show context
psychoslave ◴[] No.43503594[source]
If you are looking for alternative to kebab case to write identifier in programming language which reserve the - (U+002d) as an operator, chances are good you can use · (U+00B7 · MIDDLE DOT), that we use in middot case.

So isMorePleasantToRead, is_more_pleasant_to_read or is·more·pleasant·to·read is up to you.

replies(2): >>43503658 #>>43504170 #
thomasjb ◴[] No.43504170[source]
This is intriguing to me, do you know which (programming) languages tolerate this?
replies(2): >>43505478 #>>43508388 #
1. steveklabnik ◴[] No.43508388[source]
The reason this works in Rust is that Rust follows Unicode's categorization of which code points are useful as identifiers: https://www.unicode.org/reports/tr31/

MIDDLE DOT is Other_ID_Continue

I know less about the other languages but it wouldn't surprise me if they did similar things.