Why is Text referred to as a String in programming?

5 points by max_ ↗ HN
In all programming languages I have used, Text content is referred to as a "String".

a) Is there any programming language that refers to strings as something else?

b) Why are they called so? I however found a resource (I am not satisfied by it) http://stackoverflow.com/questions/880195/the-history-behind-the-definition-of-a-string

Disclaimer: I am a newbie coder!!

4 comments

[ 2.8 ms ] story [ 18.8 ms ] thread
Perhaps a metaphor based on the strings of beads in an abacus? I'm just speculating.
Because it refers to characters stringed together
Text and strings are two different things that can overlap.

In computer science strings are sequences of characters. Characters are members of a set called an alphabet. A string gets fed into a state machine (such as a Turing machine) and the machine accepts or rejects that string and potentially creates some side effects which may or may not be useful or interesting.

Text is something humans use to communicate with each other (when the text is not jibberish). Texts can also have a relationship with alphabets but in ordinary language we say it such text has letters which ordinary people outside of computing don't usually refer to as characters. Some texts don't have a relationship to an alphabet, e.g. those written hieroglyphic languages.

A sometimes more useful description of the sort of thing that English texts and hieroglyphic texts have in common is graphemes. And the fact that texts can use graphemes rather than characters is what makes translating strings expressing content in one language to another language non-trivial and more human knowledge than clever algorithms.

Perl 6 is a language that attempts to capture some of the nuance of the differences between human language and automata theory.

https://perl6advent.wordpress.com/2015/12/07/day-7-unicode-p...

https://en.wikipedia.org/wiki/Automata_theory