Hacker News new | ask | show | jobs
by goku12 233 days ago
> Do French (or other languages) speakers also do this?

I don't know anything about the Portuguese script. But your example seems to be made entirely of regular Latin alphabets. Now imagine another language where that isn't the case. Just switching the layout even on a programmable keyboard is going to be a major annoyance. I can touch type on two layouts (English Qwerty and Malayalam Poorna Inscript, in case you're wondering). Occasionally switching between the two layouts is the biggest distraction while typing prose - even with convenient layer switchers programmed in. Programming is going to be hell if the keywords and identifiers are in different scripts. I reckon that it would slow me down to about one-third of my full speed.

There are genuine reasons why identifiers could be in another language - like programming for linguistics (spelling and grammar checkers, morphology analyzers, etc) or while dealing with regional concepts. But even in those cases, programmers simply transliterate it into Latin script, rather than use the original script. Their sound roughly the same. But full fidelity is not possible (there are sounds that you may not have even imagined before). Even so, it's easier to just compromise on fidelity rather than do constant layout switching.

And then there is the reality that many language scripts are simply unusable for programming. My own language is agglutinative - meaning that multiple words fuse into one (even 4 words combining is not unusual). The same thing can be written in a dozen different ways. This isn't a big issue if you're reading or listening. It won't confuse you. But the moment you start applying formal rules like in a computer, it's a dozen different ways to type it wrong! I like my script for anything other than programming. It's very expressive. But the anemic simplicity of the Latin script is actually a big advantage when it comes to things like programming and mathematics. I believe that you will find many such peculiarities and nuances with other scripts if you go searching.

1 comments

> your example seems to be made entirely of regular Latin alphabets.

Portuguese is a direct descendant of Latin. But it has quite a bit of punctuation, OP just ignored that as the programming language, C, does not support it. In Common Lisp you can happily go:

    (when verificação (print “pessoa é maior de idade”))
You could even go all the way:

     (defmacro quando (cond corpo) ‘(when ,cond ,@corpo)
     (defun imprime (x) (print x))
     ; now we can do this
     (quando verificação (imprime “pessoa é maior de idade”))
Ah! Yes! I was wondering about the diacritics/accents. How do you deal with those? Do you have to switch keyboard layouts like me, or are they trivial additions to the qwerty layout?
I have 3 different keyboard layouts installed. As I live in Sweden, my keyboard shows the Swedish layout, but I also use both English and Brazilian ABNT layouts and know them by heart.

I have a single key shortcut to switch between them.

Accents work as if I was using a native keyboard, so they're not too bad (unless you're on mobile, there it sucks), except the keys do not show the right symbols. If you don't know the mappings by heart, you can get your OS to show you the layout... maybe leave that on the side and look up when you forget something.