3 ms·
Excerpt: "My keyboard doesn’t have a ] sign on it." Which leads to the following question (for future language designers)... How do developers in foreign cou
by peter_d_sherman 7y ago
Excerpt:
"My keyboard doesn’t have a ] sign on it."
Which leads to the following question (for future language designers)...
How do developers in foreign countries, using keyboards with no '[' or ']' symbols on them, type square brackets '[]' for array notation, when they are using arrays, in any programming language that requires brackets for array notation?
?
- ASalazarMX 7y agoI share with you the pain of writing a bash script with a Spanish keyboard. It has three types of ticks (`'´). The first and last are actually diacritics, so you have to press once, then press the space bar. We don't even have back diacritics in Spanish.
- GranPC 7y agoCatalan does have grave accents, and they use the same keyboard layout, so I guess it makes some sense.
- ASalazarMX 7y agoI assumed it was so they could write other European languages, but being Mexican, I didn't consider Catalan needs grave accents. Makes sense, indeed.
- thrower123 7y agoI suppose they must make EN/X dual-labeled keycaps, at least for Macbooks, where things are kinda sorta standardized? Otherwise, I guess I'd do something terrible like break out an engraving tool...
- nemetroid 7y agoI think square brackets are available in all (?) keyboard layouts, but they may not have dedicated keys. On the Swedish layout, for example, [] are typed using Alt Gr (i.e. right alt) + 8/9. I know a few developers who use an English keyboard layout when programming, just to avoid contorting their hands for these awkward key combinations.
- msla 7y agoHistorically, it was digraphs and trigraphs, or sequences of two or three characters-you-can-type standing in for a single character-you-cannot-type. https://en.wikipedia.org/wiki/Digraphs_and_trigraphs https://en.wikipedia.org/wiki/Digraphs_and_trigraphs For example, in C, ??( is [ and ??) is ] which isn't so bad, but then there's this: // Will the next line be executed????????????????/ a++; The answer is no, it won't, because ??/ is \ which means the next line gets pasted onto the end of the previous one, which is commented out. But this all goes back to ALGOL, which had some important digraphs: > Early versions of ALGOL predated the standardized ASCII and EBCDIC character sets, and were typically implemented using a manufacturer-specific six-bit character code. A number of ALGOL operations either lacked codepoints in the available character set or were not supported by peripherals, leading to a number of substitutions including := for ← (assignment) and >= for ≥ (greater than or equal).
- nisse72 7y agoHistorically, they would have used trigraphs to represent those characters. Today? Unsure. https://en.wikipedia.org/wiki/Digraphs_and_trigraphs https://en.wikipedia.org/wiki/Digraphs_and_trigraphs
- MaximumYComb 7y agoAs far as I can see, the keyboard in that article doesn't have {} either. That's going to make a number of languages difficult to program with.
- peter_d_sherman 7y agoGreat answers everyone! Thanks! (I aspire to be a future programming language designer (amongst too many other future aspirations!), so this information will be remembered into the future!)