Why is Text referred to as a String in programming?
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 ] threadIn 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