6

Possible Duplicate:
The History Behind the Definition of a ‘String’…

In most programming languages a string is a sequence of characters. Why is it named that?

The earliest instance of it being called a string is Algol 60 (as far as I know).

Question posed by Douglas Crockford in his talk today (will post when talk is online).

Community
  • 1
  • 1
Paul Tarjan
  • 48,968
  • 59
  • 172
  • 213
  • 3
    characters in a line like beads on a string.... – Mitch Wheat Feb 06 '10 at 03:34
  • {{Citation Needed}} :) As a language designer, I hope I could think of better things to name it. After all, they are arrays not linked lists. – Paul Tarjan Feb 06 '10 at 05:45
  • 1
    Exact duplicate: http://stackoverflow.com/questions/880195/the-history-behind-the-definition-of-a-string – JRL Feb 06 '10 at 06:17
  • I wonder why that question never came up when I posted this one. The accepted answer was from a single message board post about a dictionary from 1971 without any other references. Lets see if we can do better. – Paul Tarjan Feb 06 '10 at 07:49
  • Wikipedia: [http://en.wikipedia.org/wiki/String_(computer_science)](http://en.wikipedia.org/wiki/String_(computer_science)) – SQLMenace Feb 06 '10 at 03:34

3 Answers3

6

I believe it comes from math theory. Sets, grammars, languages, strings, etc.

Jeff Ober
  • 4,967
  • 20
  • 15
  • 2
    @Jeff Ober: first time I've heard that.... – Mitch Wheat Feb 06 '10 at 03:35
  • 1
    Any references? Do grammars predate Algol60? I studied Pure Math and I don't remember things called strings (unless they were Computer Sciency math classes, and then they were used). – Paul Tarjan Feb 06 '10 at 04:45
2

A string is a string of characters. It is a common use of the word, and it dates all the way back to 1488.

string (n.)

O.E. streng "line, cord, thread," from P.Gmc. *strangiz (cf. O.N. strengr, Dan. streng, M.Du. strenge, Du. streng, O.H.G. strang, Ger. Strang "rope, cord"), from base *strang- "taut, stiff," from PIE base *strenk- "tight, narrow; pull tight, twist" (see strain). Gradually restricted by early M.E. to lines that are smaller than a rope. Sense of "a number of objects arranged in a line" first recorded 1488. [...]

http://www.etymonline.com/index.php?term=string

Don Reba
  • 13,814
  • 3
  • 48
  • 61
0

I guess it comes from math... In math, a string is a sequence of symbols, which nicely explains the essence of a string in programming-languages too.

Frederik Wordenskjold
  • 10,031
  • 6
  • 38
  • 57