this post was submitted on 23 Aug 2023
71 points (94.9% liked)

Programming

21961 readers
204 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

The title would probably be confusing, but I could not make it better than this. I noticed that most programming languages are limited to the alphanumerical set along with the special characters present in a general keyboard. I wondered if this posed a barrier for developers on what characters they were limited to program in, or if it was intentional from the start that these keys would be the most optimal characters for a program to be coded in by a human and was later adopted as a standard for every user. Basically, are the modern keyboards built around programming languages or are programming languages built around these keyboards?

all 20 comments
sorted by: hot top controversial new old
[–] marcos@lemmy.world 21 points 2 years ago (1 children)

It was a noisy co-evolution where both languages and keyboards keep changing to best fit each other.

While the letter layout of our keyboards is heavily influenced by typewriters, the set of symbols on them changed a lot with times, and for some times there was a lot of diversity on them. Our current design is as much a result of languages like MPL never really popularizing as much as the lack of adoption of those languages is a result of the popular keyboard designs.

[–] vashti@feddit.uk 2 points 2 years ago

Yeah. 7-bit ASCII goes back to what, the 60s? But computers still used different encodings and so different keyboards for A While.

[–] fubo@lemmy.world 20 points 2 years ago* (last edited 2 years ago) (1 children)

C supports alternate ways of typing some of its punctuation, for programmers whose keyboards didn't support them all. For example, if you can't type [ ] you can use ??( ??) instead. (There are other ones that use angle brackets, but I can't type them here because Lemmy escapes them incorrectly. Irony.)

https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C


The usual example of a programming language using especially unusual characters is APL, where all built-in functions are all represented by single characters, mostly drawn from mathematical notations, Greek alphabet, and so on. For example, is the "sort" function.

[–] Turun@feddit.de 17 points 2 years ago (1 children)

Not only do the Languages orient themselves to fit to the keyboard, they pretty much only consider the English keyboard layout.

[–] Lmaydev@programming.dev 1 points 2 years ago

Rule Britannia mother fuckers!

[–] OofShoot@beehaw.org 15 points 2 years ago

Programming languages are build around the standard keyboard. Keyboards had most of the symbols you're thinking of from their typewriter days. You can see most of the special characters in these small typewriters from the mid 1900s.

https://dealdashreviewed.com/wp-content/uploads/2015/02/typerwriter.jpg

https://3.bp.blogspot.com/-gdj1kOXgkTY/UqYxNGAxBBI/AAAAAAAA8T0/DTeg3C_ydXM/s1600/71-6zsvcleL._SL1500_.jpg

With things like electric Wheel Writer typewriters, adding extra keys and symbols were less of a complexity issue and you started to see a few more extra symbols.

https://www.imagine41.com/wp-content/uploads/2016/07/ibm_wheelwriter_2500_002_1.jpg

Recognize that there never has been a hard standard for layouts and symbols, just the industry copying and converging on systems that became popular.

[–] Die4Ever@programming.dev 12 points 2 years ago* (last edited 2 years ago) (3 children)

I won't consider any keyboard to be designed for programming unless it has dedicated keys for characters like {}() < >_+| & !*:" without needing to hold shift for them (Lemmy seems to be improperly escaping my less-than sign and ampersand)

[–] driving_crooner@lemmy.eco.br 5 points 2 years ago

There's "programming" layouts, like dvorak-programming that replace the number rows for special characters and you need to shift to get the numbers.

[–] oktux@lemmy.world 6 points 2 years ago (1 children)
[–] BradleyUffner@lemmy.world 3 points 2 years ago (2 children)

Some of the "toy" languages used for code-golf can use some very non standard characters. Saying "all programming languages" is going to be very restrictive.

[–] sylowosa@lemm.ee 1 points 2 years ago

Fixed 'all'. I tried to acknowledge that there may be other languages that may not follow this rule, but I seem to have not noticed this mistake.

[–] jvisick@programming.dev 1 points 2 years ago (1 children)

That’s a little pedantic, don’t you think?

[–] BradleyUffner@lemmy.world 1 points 2 years ago

Ohh very much so. This wasn't meant as a criticism of OP's question. I was just trying to make sure they were aware of all the niche programming languages out there, especially the ones that use some rather exotic character sets.

[–] vodnik@lemmy.world 1 points 2 years ago

Have a look at APL