Why String?
-
I was just thinking that it seems a bit odd that "string" is so commonly used by programmers to refer to some text. I would think "text" would be more appropriate. If we are using "string" just because it refers to a string of characters (aka, a sequence of characters), then why not also call numbers "strings" (as they are strings/sequences of digits and some other characters)? Any theories as to why "string" prevailed?
I think it's an unconscious desire to return to the good old days of BASIC where a variable was identified as containing text characters by using the suffix $. The art of programming has never recovered from the damage done by constructs like, >10 DATA "MY", "TEXT", "DATA" >20 READ A$, B$, C$ >30 LPRINT A$, B$, C$ >50 GOTO 10 >9999 END >RUN Back in the day, A$ was even pronounced, "A-string." :-D
Will Rogers never met me.
-
I was just thinking that it seems a bit odd that "string" is so commonly used by programmers to refer to some text. I would think "text" would be more appropriate. If we are using "string" just because it refers to a string of characters (aka, a sequence of characters), then why not also call numbers "strings" (as they are strings/sequences of digits and some other characters)? Any theories as to why "string" prevailed?
AspDotNetDev wrote:
Any theories as to why "string" prevailed?
Well if we called
int
sstring
s then how would we differentiate betweenint
s andstring
s? Another reason is that numeric data types are treated atomically by the CPU, whereas a string is simply a sequence of bytes of arbitrary length.The difficult we do right away... ...the impossible takes slightly longer.
-
I was just thinking that it seems a bit odd that "string" is so commonly used by programmers to refer to some text. I would think "text" would be more appropriate. If we are using "string" just because it refers to a string of characters (aka, a sequence of characters), then why not also call numbers "strings" (as they are strings/sequences of digits and some other characters)? Any theories as to why "string" prevailed?
Back in the day, Computers were made of rope and wood , and each character was knotted onto a length of string. Sometimes the string would unravel. Hence the early programmers mantra - did it compile? I'm a frayed knot.
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
-
Back in the day, Computers were made of rope and wood , and each character was knotted onto a length of string. Sometimes the string would unravel. Hence the early programmers mantra - did it compile? I'm a frayed knot.
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
:laugh:
public class SysAdmin : Employee
{public override void DoWork(IWorkItem workItem) { if (workItem.User.Type == UserType.NoLearn){ throw new NoIWillNotFixYourComputerException(new Luser(workItem.User)); }else{ base.DoWork(workItem); } }
}
-
Back in the day, Computers were made of rope and wood , and each character was knotted onto a length of string. Sometimes the string would unravel. Hence the early programmers mantra - did it compile? I'm a frayed knot.
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
Sounds like quite the yarn. :)
-
I was just thinking that it seems a bit odd that "string" is so commonly used by programmers to refer to some text. I would think "text" would be more appropriate. If we are using "string" just because it refers to a string of characters (aka, a sequence of characters), then why not also call numbers "strings" (as they are strings/sequences of digits and some other characters)? Any theories as to why "string" prevailed?
public class SysAdmin : Employee
{public override void DoWork(IWorkItem workItem) { if (workItem.User.Type == UserType.NoLearn){ throw new NoIWillNotFixYourComputerException(new Luser(workItem.User)); }else{ base.DoWork(workItem); } }
}
-
Sounds like quite the yarn. :)
:laugh:
public class SysAdmin : Employee
{public override void DoWork(IWorkItem workItem) { if (workItem.User.Type == UserType.NoLearn){ throw new NoIWillNotFixYourComputerException(new Luser(workItem.User)); }else{ base.DoWork(workItem); } }
}
-
public class SysAdmin : Employee
{public override void DoWork(IWorkItem workItem) { if (workItem.User.Type == UserType.NoLearn){ throw new NoIWillNotFixYourComputerException(new Luser(workItem.User)); }else{ base.DoWork(workItem); } }
}
That hurts my membrane so much I feel like a p-brane, but lucky for me I think you're just stringing me along this thread.
-
That hurts my membrane so much I feel like a p-brane, but lucky for me I think you're just stringing me along this thread.
:laugh: I didn't even know there was an official string theory website!
public class SysAdmin : Employee
{public override void DoWork(IWorkItem workItem) { if (workItem.User.Type == UserType.NoLearn){ throw new NoIWillNotFixYourComputerException(new Luser(workItem.User)); }else{ base.DoWork(workItem); } }
}
-
Sounds like quite the yarn. :)
He's just trying to rope you in!
Silence is golden... but duct tape is silver!! Booger Mobile - My bright green 1964 Ford Falcon - check out the blog here!! | If you feel generous - make a donation to Camp Quality!!
-
He's just trying to rope you in!
Silence is golden... but duct tape is silver!! Booger Mobile - My bright green 1964 Ford Falcon - check out the blog here!! | If you feel generous - make a donation to Camp Quality!!
C'mon, cut him some slack.
The difficult we do right away... ...the impossible takes slightly longer.
-
C'mon, cut him some slack.
The difficult we do right away... ...the impossible takes slightly longer.
Thanks, I can't get tied up at the moment.
-
I was just thinking that it seems a bit odd that "string" is so commonly used by programmers to refer to some text. I would think "text" would be more appropriate. If we are using "string" just because it refers to a string of characters (aka, a sequence of characters), then why not also call numbers "strings" (as they are strings/sequences of digits and some other characters)? Any theories as to why "string" prevailed?
I once read in a book, which was about learning C programming, that the name string was chosen because in C there is no text data type, but an array of characters. An array could be seen as a "chain" of characters, or a "string" of characters (one right after the other). In Spanish, by the way, the name is "cadena de caracteres" which translates to "character chain" rather than string. Don't know if this is true though.
-
I was just thinking that it seems a bit odd that "string" is so commonly used by programmers to refer to some text. I would think "text" would be more appropriate. If we are using "string" just because it refers to a string of characters (aka, a sequence of characters), then why not also call numbers "strings" (as they are strings/sequences of digits and some other characters)? Any theories as to why "string" prevailed?
Because you could never tell how long it is. Cheers ;P Peter
Software rusts. Simon Stephenson, ca 1994.
-
I was just thinking that it seems a bit odd that "string" is so commonly used by programmers to refer to some text. I would think "text" would be more appropriate. If we are using "string" just because it refers to a string of characters (aka, a sequence of characters), then why not also call numbers "strings" (as they are strings/sequences of digits and some other characters)? Any theories as to why "string" prevailed?
Because even the best C programmers end up hanging themselves with them at some point in time.
-
I was just thinking that it seems a bit odd that "string" is so commonly used by programmers to refer to some text. I would think "text" would be more appropriate. If we are using "string" just because it refers to a string of characters (aka, a sequence of characters), then why not also call numbers "strings" (as they are strings/sequences of digits and some other characters)? Any theories as to why "string" prevailed?
AspDotNetDev wrote:
they are strings/sequences of digits
No they're not -- unless you use ToString.
AspDotNetDev wrote:
Any theories as to why "string" prevailed?
Because in BASIC they are designated by a $ which is a lot like an S and they who use BASIC are hard to teach.
-
I think it's an unconscious desire to return to the good old days of BASIC where a variable was identified as containing text characters by using the suffix $. The art of programming has never recovered from the damage done by constructs like, >10 DATA "MY", "TEXT", "DATA" >20 READ A$, B$, C$ >30 LPRINT A$, B$, C$ >50 GOTO 10 >9999 END >RUN Back in the day, A$ was even pronounced, "A-string." :-D
Will Rogers never met me.
Oh my eyes.....noooooooooooo
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1 -
Sounds like quite the yarn. :)
Hope I pulled the wool over your eyes ;)
MVVM# - See how I did MVVM my way ___________________________________________ Man, you're a god. - walterhevedeich 26/05/2011 .\\axxx (That's an 'M')
-
I was just thinking that it seems a bit odd that "string" is so commonly used by programmers to refer to some text. I would think "text" would be more appropriate. If we are using "string" just because it refers to a string of characters (aka, a sequence of characters), then why not also call numbers "strings" (as they are strings/sequences of digits and some other characters)? Any theories as to why "string" prevailed?
My first acquaintance with "strings" was in the pre-computer days (early eighties, in India - there were no or very very few computers then; the nearest one was a Casio calculator), when we did physics experiments with standing waves or stationary waves. We had to find nodes, also called stationary points. So, when I had to first program with strings using MFC, it took some time to unlearn the wave part, and get used to strings within quotes.
-
I think it's an unconscious desire to return to the good old days of BASIC where a variable was identified as containing text characters by using the suffix $. The art of programming has never recovered from the damage done by constructs like, >10 DATA "MY", "TEXT", "DATA" >20 READ A$, B$, C$ >30 LPRINT A$, B$, C$ >50 GOTO 10 >9999 END >RUN Back in the day, A$ was even pronounced, "A-string." :-D
Will Rogers never met me.
It's like inverted PHP! My eyes!! :)
- S 50 cups of coffee and you know it's on! Code, follow, or get out of the way.