Story called "String"

I never thought about this until recently, but I'm not sure why we call strings . I am a .NET programmer, but I believe that the concept of strings exists in almost all programming languages.

Outside of programming, I don’t believe I heard the word string used to describe words or letters. The quick Google from “Define: string” gives you many definitions that have nothing to do with the concept of letters, words, or anything related to programming.

I assume that on this day the lines were really just arrays of characters of a certain length, often with a separator at the end. But I do not see a natural transition from "array of characters" to string .

Can anyone make it clear why we call strings strings ?

+59
string terminology programming-languages history
May 18, '09 at 22:54
source share
10 answers

From this link :

The 1971 OED (p. 3097) cites 1891 Words of the Century according to a source in the Milwaukee Sentinel of January 11, 1898 (section 3, p. 1) that this is the term of the composer. Printers will insert text that they had generated in a long strip of characters. (Presumably, they were paid by feet, not by the word!) The quote says that it was unusual for composers to create more than 1,500 (characters?) Per hour.

+28
May 18 '09 at 23:02
source share

My assumption has always been that the programming term came from the following definition of the word "string" (from Merriam-Webster):

(1): a number of things located in or as if in the line <car line> <name line>

(2): a sequence of similar elements (in the form of bits, characters or words)

Since a string in programming is simply an ordered sequence of characters, referring to it as a “string of characters” (or simply a “string”), it seems to be the most likely origin.

+33
May 18 '09 at 10:59 p.m.
source share

From a search in the ACM bibliography, it seems that the phrase acquired meaning in computer science in the 1960s. At the beginning, a line is a general view of a sequence or list, for example. The command language for processing character strings from 1958.

This article explicitly mentions "character strings" in 1964.

Unfortunately, I can’t access the full texts that are behind the paid booth.

+11
May 19 '09 at 7:31 a.m.
source share

I suspect this because string originally meant simply a sequence of data values: "I just combine them together," etc. These values ​​do not have to be characters. One of the most common uses for this general concept was a sequence of characters, and this prevailed as the general meaning of the word.

+6
May 18 '09 at 23:00
source share

I guessed that the "string" was used by mathematicians long before its adoption in programming languages. Turing machines work efficiently on strings. Turing may not have used the term, but it is used universally in machine gun textbooks, starting for decades.

The earliest link I could find was a snippet in Google books of a 1944 article, "Recursively enumerated sets of positive integers and problems of their solution," by Emil Post in the AMS Bulletin. Fortunately, AMS provides online archives of full articles for free to download. Here is the link: http://www.ams.org/journals/bull/1944-50-05/S0002-9904-1944-08111-1/S0002-9904-1944-08111-1.pdf

I think that there is no doubt that he uses the "string" in the usual sense used in computer science. P. 286 "For business purposes, enter the letter b and consider the" lines "1 and b, such as 11b1bb1. The operation on lines such as" b1bP, produces P1bb1 "we call the normal operation. This particular normal operation is ap- only lines starting with b1b, and the derived line is then obtained from the given line, first deleting the original b1b and then overlapping 1bb1 at the end. Thus, b1bb becomes b1bb1. "

+6
Jun 22 2018-11-11T00:
source share

The earliest reference I could find in computing is from March 1963 METEOR: A LISP Interpreter for String Conversations by Daniel G. Bobrov MIT AI Labs.

However, the definition of 15d. in the Oxford English Dictionary:

Calculation A linear sequence of records or data.

... and with the first quote from the Journal of the Association of Computing Engineering in 1956:

Areas are reserved for moving rows of control fields back and forth until a fully sorted sequence is obtained.

This use naturally follows from the definition of 15c .:

Math. etc. A sequence of characters or linguistic elements in a specific order.

... and first used in Clarence Irving Lewis and Cooper Harold Langford's Symbolic Logic (1932):

Sentences are not label strings or series of sounds, except random.

This, in turn, follows from many other, much earlier definitions for things in a line.

+5
May 30 '11 at 20:07
source share

The word was originally used to distinguish between a set of values ​​for which a specific order of elements does not matter (for example, a set of random samples of dimensions), and another that could only have its own meaning when the order is also preserved. Initially, a string could be a set of any values, but since in the post-mainframe era, a string of characters is the most common type, the fact that values ​​are characters has become "standard."

+2
May 18 '09 at 23:18
source share

In a conversation about Javascript history, Douglas Crockford says “Nobody Knows” and gives several alternatives: http://www.youtube.com/watch?v=RO1Wnu-xKoY#t=2989

I found a report that allegedly has the first link in the history of computers to a series of characters as a "string". I think this is in the upper right column of page 4 pdf, which is numbered 47:

http://web.eecs.umich.edu/~bchandra/courses/papers/Naure_Algol60.pdf

+1
Nov 07 '13 at 11:56
source share

A string is a sequence of discrete objects (usually a char ).

Given this, I will probably venture to suggest that this may be due to the metaphor associated with the “pearl chain”. Each bit in a string is a single character.

+1
Jul 26 '14 at 2:10
source share

It is called strings because it is actually an array of char elements.

Having said that, they are “pulled together” (or hidden together) through this array, which turns them into a “string”.

-one
May 18 '09 at 10:58 p.m.
source share



All Articles