Talk:String (computing)

From Citizendium
Revision as of 14:41, 15 April 2010 by imported>Ed Poor (Shall I try to flesh this out?)
Jump to navigation Jump to search
This article is a stub and thus not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
To learn how to update the categories for this article, see here. To update categories, edit the metadata template.
 Definition In computing and more specifically in various programming languages, a variable type that can hold text [d] [e]
Checklist and Archives
 Workgroup category Computers [Categories OK]
 Talk Archive none  English language variant American English

So far, this article has a bit too much (and yet not enough) about how a language like Python may automatically assign a string or numeric type to a variable.

As a programmer, I'd like to point out that the value "123" as a string is merely a series of three characters, while 123 is an integer. In certain contexts, you'd like them to be considered equal, but in others you might not.

  • When append the character "4" to the string, you'd expect to get "1234", which could be a phone extension or a serial number.
  • When adding the number 4 to the number 123 you need to get 127 as a sum.

I don't know whether our article should begin with this problem. Maybe we should write a bit more about what a string is, and give examples in several languages. I can write about Visual Basic, C, Java, PHP and (shudder) "JavaScript". --Ed Poor 19:41, 15 April 2010 (UTC)