Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Why String?

Why String?

Scheduled Pinned Locked Moved The Lounge
comquestion
70 Posts 49 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AspDotNetDev
    wrote on last edited by
    #1

    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?

    Thou mewling ill-breeding pignut!

    R Richard Andrew x64R L B F 26 Replies Last reply
    0
    • A AspDotNetDev

      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?

      Thou mewling ill-breeding pignut!

      R Offline
      R Offline
      Roger Wright
      wrote on last edited by
      #2

      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.

      M Steve EcholsS P M M 6 Replies Last reply
      0
      • A AspDotNetDev

        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?

        Thou mewling ill-breeding pignut!

        Richard Andrew x64R Offline
        Richard Andrew x64R Offline
        Richard Andrew x64
        wrote on last edited by
        #3

        AspDotNetDev wrote:

        Any theories as to why "string" prevailed?

        Well if we called ints strings then how would we differentiate between ints and strings? 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.

        1 Reply Last reply
        0
        • A AspDotNetDev

          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?

          Thou mewling ill-breeding pignut!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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')

          B A D K 4 Replies Last reply
          0
          • L Lost User

            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')

            B Offline
            B Offline
            Brisingr Aerowing
            wrote on last edited by
            #5

            :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);
                  }
             }
            

            }

            1 Reply Last reply
            0
            • L Lost User

              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')

              A Offline
              A Offline
              AspDotNetDev
              wrote on last edited by
              #6

              Sounds like quite the yarn. :)

              Thou mewling ill-breeding pignut!

              B _ L 3 Replies Last reply
              0
              • A AspDotNetDev

                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?

                Thou mewling ill-breeding pignut!

                B Offline
                B Offline
                Brisingr Aerowing
                wrote on last edited by
                #7

                String Theory?[^]

                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);
                      }
                 }
                

                }

                A 1 Reply Last reply
                0
                • A AspDotNetDev

                  Sounds like quite the yarn. :)

                  Thou mewling ill-breeding pignut!

                  B Offline
                  B Offline
                  Brisingr Aerowing
                  wrote on last edited by
                  #8

                  :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);
                        }
                   }
                  

                  }

                  1 Reply Last reply
                  0
                  • B Brisingr Aerowing

                    String Theory?[^]

                    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);
                          }
                     }
                    

                    }

                    A Offline
                    A Offline
                    AspDotNetDev
                    wrote on last edited by
                    #9

                    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.

                    Thou mewling ill-breeding pignut!

                    B 1 Reply Last reply
                    0
                    • A AspDotNetDev

                      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.

                      Thou mewling ill-breeding pignut!

                      B Offline
                      B Offline
                      Brisingr Aerowing
                      wrote on last edited by
                      #10

                      :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);
                            }
                       }
                      

                      }

                      1 Reply Last reply
                      0
                      • A AspDotNetDev

                        Sounds like quite the yarn. :)

                        Thou mewling ill-breeding pignut!

                        _ Offline
                        _ Offline
                        _Damian S_
                        wrote on last edited by
                        #11

                        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!!

                        Richard Andrew x64R 1 Reply Last reply
                        0
                        • _ _Damian S_

                          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!!

                          Richard Andrew x64R Offline
                          Richard Andrew x64R Offline
                          Richard Andrew x64
                          wrote on last edited by
                          #12

                          C'mon, cut him some slack.

                          The difficult we do right away... ...the impossible takes slightly longer.

                          A 1 Reply Last reply
                          0
                          • Richard Andrew x64R Richard Andrew x64

                            C'mon, cut him some slack.

                            The difficult we do right away... ...the impossible takes slightly longer.

                            A Offline
                            A Offline
                            AspDotNetDev
                            wrote on last edited by
                            #13

                            Thanks, I can't get tied up at the moment.

                            Thou mewling ill-breeding pignut!

                            R 1 Reply Last reply
                            0
                            • A AspDotNetDev

                              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?

                              Thou mewling ill-breeding pignut!

                              F Offline
                              F Offline
                              Fernando A Gomez F
                              wrote on last edited by
                              #14

                              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.

                              1 Reply Last reply
                              0
                              • A AspDotNetDev

                                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?

                                Thou mewling ill-breeding pignut!

                                P Offline
                                P Offline
                                Peter_in_2780
                                wrote on last edited by
                                #15

                                Because you could never tell how long it is. Cheers ;P Peter

                                Software rusts. Simon Stephenson, ca 1994.

                                1 Reply Last reply
                                0
                                • A AspDotNetDev

                                  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?

                                  Thou mewling ill-breeding pignut!

                                  J Offline
                                  J Offline
                                  Jason Hooper
                                  wrote on last edited by
                                  #16

                                  Because even the best C programmers end up hanging themselves with them at some point in time.

                                  Jason

                                  1 Reply Last reply
                                  0
                                  • A AspDotNetDev

                                    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?

                                    Thou mewling ill-breeding pignut!

                                    P Offline
                                    P Offline
                                    PIEBALDconsult
                                    wrote on last edited by
                                    #17

                                    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.

                                    1 Reply Last reply
                                    0
                                    • R Roger Wright

                                      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.

                                      M Offline
                                      M Offline
                                      Mike Hankey
                                      wrote on last edited by
                                      #18

                                      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

                                      R 1 Reply Last reply
                                      0
                                      • A AspDotNetDev

                                        Sounds like quite the yarn. :)

                                        Thou mewling ill-breeding pignut!

                                        L Offline
                                        L Offline
                                        Lost User
                                        wrote on last edited by
                                        #19

                                        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')

                                        1 Reply Last reply
                                        0
                                        • A AspDotNetDev

                                          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?

                                          Thou mewling ill-breeding pignut!

                                          A Offline
                                          A Offline
                                          Amarnath S
                                          wrote on last edited by
                                          #20

                                          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.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups