Content deleted Content added
Stevebroshar (talk | contribs) |
→String length: new section |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 172:
TBO this article provides little value and should be deleted, but I'm sure folks don't like that idea. But, if it's going to exist, it shouldn't misrepresent the world. [[User:Stevebroshar|Stevebroshar]] ([[User talk:Stevebroshar|talk]]) 13:19, 10 May 2025 (UTC)
:I think you have a point here, and I tried to fix the lead accordingly. - [[User:Jochen Burghardt|Jochen Burghardt]] ([[User talk:Jochen Burghardt|talk]]) 16:18, 11 May 2025 (UTC)
: There are other languages than C. In some of them, strings are a native data type. You can make a similar argument about arrays. Citing a WP article to show that strings aren't a [[data type]] might carry more weight if that article didn't include them [[data type#String and text types]]. [[User:Andy Dingley|Andy Dingley]] ([[User talk:Andy Dingley|talk]]) 16:45, 11 May 2025 (UTC)
== String length ==
The description in {{alink||String length}} is overly simplistic and is incorrect for, e.g., [[PL/I]].
I propose changing {{blockquote|In general, there are two types of string datatypes: ''fixed-length strings'', which have a fixed maximum length to be determined at [[compile time]] and which use the same amount of memory whether this maximum is needed or not, and ''variable-length strings'', whose length is not arbitrarily fixed and which can use varying amounts of memory depending on the actual requirements at run time (see [[Memory management]]).}}
to {{blockquote|In general, there are three types of string datatypes: ''fixed-length strings'', which have a fixed length to be determined at [[compile time]] or [[block (programming)|block]] entry, ''variable-length strings'', which have a fixed maximum length to be determined at [[compile time]] or [[block (programming)|block]] entry and which use the same amount of memory whether this maximum is needed or not, and ''dynamic-length strings'', whose length is not arbitrarily fixed and which can use varying amounts of memory depending on the actual requirements at run time (see [[Memory management]]).}}
I was tempted to cite languages with each type of string, but that might be [[information overload|TMI]].
I suspect that most modern programming languages have dynamic-length strings, so the rest of the paragraph may also need changes. -- [[User:Chatul|Shmuel (Seymour J.) Metz Username:Chatul]] ([[User talk:Chatul|talk]]) 12:51, 11 August 2025 (UTC)
|