5 ms·
Wow, I was not expecting that! Was this style of C common back then? Before he wrote the Bourne shell the author wrote an ALGOL compiler, and ALGOL inspired Bo
by teruakohatu 2y ago
Wow, I was not expecting that! Was this style of C common back then?
Before he wrote the Bourne shell the author wrote an ALGOL compiler, and ALGOL inspired Bourne syntax:
https://en.wikipedia.org/wiki/ALGOL_68C https://en.wikipedia.org/wiki/ALGOL_68C
- pasc1878 2y agoThere were article suggesting #define BEGIN { and #define end }; to make C look more like Pascal. I think in Europe C was not as common as other languages at the time so the terseness looked odd.
- pavlov 2y agoAlso because the special characters were (and are) difficult to type on European keyboards. Characters like []{}\|~ are behind multi-finger access and often not printed at all on the physical keys (at least in the past). You can see how this adds a hurdle to writing C… Pascal was designed by a European, so he preferred keywords which could be typed on every international keyboard. C basically just used every symbol from 7-bit ASCII that happened to be on the keyboards in Bell Labs.
- smatija 2y agoJust as example, on my slovenian QWERTZ layout: [ - altgr+f, ] - altgr+g, { - altgr+b, } - altgr+n, \ - altgr+q, | - altgr+w, ~ - altgr+1. You get used to them, though you start feeling like a pianist after a short coding session. The one most annoying for me are the fancy javascript/typescript quotes, which I have to use all too often: ` - altgr+7.
- ulbu 2y agoToday I learned that there exist people who use non-US layouts when coding. That’s spectacular!
- pavlov 2y agoHow did you think people outside the US learn programming?
- anthk 2y agosetxkbmap us -option ctrl:swapcaps -option compose:rwin Problem solved. US layout, and with the right Window keys you can compose European characters.
- pavlov 2y agoThere’s so many assumptions here about a person who’s starting to learn programming. For starters, that they’re on Linux, they feel comfortable running complex CLI commands, they can memorize the U.S. layout just like that, and that they can type without looking at the physical keys (because changing the virtual mapping means keys produce something else than what the label says). In reality, the learner’s first exposure to C family languages is more likely to be a website where you can run some JavaScript in a text box. And the first hurdle is to figure out how to even type {}. American developers just completely forget about that.
- anthk 2y agoOn the long term, using the native keyboard hinders yourself a lot. I tried to do so with the Spanish (es) layout, it's pretty much unergonomical. It's looks like being deliberately designed for press/office usage and not for proper programming.
- SSLy 2y agoor maybe popular proglangs were designed for writing on USAn press/office keyboards – remember that UNIX came to be as a typesetting appliance — disregarding anyone else.
- pavlov 2y agoI’ve been writing C and its progeny (C++, JavaScript, Rust etc.) since 1990 on a Finnish keyboard. The AltGr brackets are fine. The truly annoying character to type is the backtick (which is a quite new addition to the pantheon of special characters, C doesn’t use it). My personal opinion is that Niklaus Wirth had the better overall ideas about clarity and inclusiveness in programming language design, but that battle is long lost. (What you consider the character set needed for "proper programming" is really a relatively new development, mid-1990s and later.)
- fuzztester 2y agoIIRC, Pascal had/has (* and *) as an alternative to { and } , from the start, or from early on - as syntax for start comment and end comment.