5 ms·
It's very odd for me to see the grave accent (`) as quoting mark in bash and other programming languages. I understand that the accent alone lose its function f
by garou 9y ago
It's very odd for me to see the grave accent (`) as quoting mark in bash and other programming languages.
I understand that the accent alone lose its function for the human language. But still uncomfortable to se an accent as delimiter to a string.
- sp332 9y agoI'm not even sure why ASCII has a grave accent. There are no combining marks so you could never write it over another letter. Edit: I forgot HTAB was actually part of ASCII. Oh well!
- saint_fiasco 9y agoIn ASCII instead of combining marks what you have to do is write three characters: * The unaccented letter * The backspace character * The accent character If this makes no sense to you, try to imagine a literal, physical typewriter. Windows line terminators also work with a similar principle.
- cesarb 9y agoFrom what I recall from my childhood, physical typewriters worked slightly differently: the accent keys were non-advancing ("dead") keys. You pressed the "acute" key followed by the "e" key for an é, for instance. If you wanted a bare accent, you pressed the accent key followed by the space bar. (The typewriters I recall also didn't have a 0 or 1 key, you used uppercase O or I for these numbers.)
- kps 9y agoYes. I consider it a mistake of Unicode that combining characters follow rather than precede the base character. If they preceded, most dead keys could simply generate the appropriate combining character, rather than requiring complicated input method support. (And finding the end of a sequence of multiple combining character wouldn't require lookahead.)
- moron4hire 9y agoThe Unicode way makes sorting easier. Your way would require special knowledge about the characters to know that ä should sort directly after a, rather than directly before ë.
- jrochkind1 9y agoIn fact this requires special language-specific knowledge anyway (which unicode provides in some tables and algorithms actually). In some languages ä should sort exactly as if it were 'a'. "aa", "äb", "ac". In others it should sort as a distinct letter (but not necessarily between 'a' and 'b'). Different Latin languages sort differently, I'm not sure if exact UTF-8 (or UTF 16 or UTF 32) byte ordering is actually appropriate collation in any latin-alphabet language. But I do suspect it had something to do with ascii compatibility, I don't recall what. Very little of unicode is accidental, there's usually some reason for whatever in it.
- cassowary 9y agosome languages even sort aa ah az ba bh bz ca cz ch treating "ch" as a single letter that comes between c and d. or ab ah az b c .... z aa treating aa the same as a separate letter at the end of the alphabet. Then there's other rules for sorting that aren't directly alphabetic, like that names beginning with "Mc" should be treated as "Mac" or "St " as "Saint ". "10 cats" should sort after "2 cats", not before it. Anyone who tries to sort by just numeric ordering is doing it wrong.
- kalleboo 9y agoExcept not really, since in Swedish, it's sorted xyzåäö, not aåäbc. Also, it used to be that w and v were equivalent sorting-wise and you'd mix them together.
- eesmith 9y agoI believe that depended on the manufacturer and country convention. Most US keyboards didn't have an accent character. For example, here's one from the 1950s: http://www.typewriters101.com/uploads/1/7/6/6/17660651/s766280042808218667_p19_i1_w2560.jpeg http://www.typewriters101.com/uploads/1/7/6/6/17660651/s7662... For acute or umlaut you could use a + backspace + ' or u + backspace + " (or the opposite order). For grave or circumflex, I don't think there was a solution. Write it in by hand?
- cassowary 9y agoWhen I was in school back in the 1990s, that was certainly the approach taken for the Vietnamese edition of the school newsletter.
- electroly 9y agoOn a teletype, ALL characters are combining marks because you can backspace (another ASCII character derived directly from teletype codes) and type another character overtop it.
- deleted 9y ago[deleted]
- reaperducer 9y agoAre you old enough to remember when you printed your code on a teletype machine that blank spaces were represented by a "b" with a slash through it? I hated that. Even worse, I remember one shop where the teletypes didn't have question marks, so people used capital P's instead.
- unkown-unknowns 9y agoWell, we also use the dollar sign to signify a variable in bash and PHP even though we aren't talking about an amount of USD. Likewise we use single and doublequote to mean special things. HTML tags have nothing to do with less than or greater than, yet here we are. In conclusion, it's simply convenient to use the standard keys we have and to use the symbols that are on it to mean something different from their original meaning in order to be able to express ourselves succinctly so that we don't have to spend so much time typing as we'd otherwise have to. Of course you could always buy yourself an APL keyboard and write your programs in APL and use an APL REPL as your command line instead of using bash ;)