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 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
              • 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.

                Steve EcholsS Offline
                Steve EcholsS Offline
                Steve Echols
                wrote on last edited by
                #21

                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.

                • S
                  50 cups of coffee and you know it's on!
                  Code, follow, or get out of the way.
                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!

                  S Offline
                  S Offline
                  Shao Voon Wong
                  wrote on last edited by
                  #22

                  It is according to the Grand Unified Theory of Programming, a string can store all the values of any plain old data(POD)! Also known as the String Theory of programming. This is why text type is known as string!

                  1 Reply Last reply
                  0
                  • M Mike Hankey

                    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 Offline
                    R Offline
                    Roger Wright
                    wrote on last edited by
                    #23

                    Here, this[^] may help...

                    Will Rogers never met me.

                    M S 2 Replies 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.

                      P Offline
                      P Offline
                      peterchen
                      wrote on last edited by
                      #24

                      I feel toddler bliss again!

                      FILETIME to time_t
                      | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

                      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
                        Jorgen Andersson
                        wrote on last edited by
                        #25

                        The first computers used quipus[^] as storage media.

                        Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

                        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!

                          V Offline
                          V Offline
                          V 0
                          wrote on last edited by
                          #26

                          I use it because it reminds me of something else[^]...

                          V.

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

                            C Offline
                            C Offline
                            CPallini
                            wrote on last edited by
                            #27

                            Please don't add complexity to complexity. At the moment I'm puzzled by a man who calls himself 'AspDotNetDev'. :rolleyes:

                            Veni, vidi, vici.

                            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!

                              M Offline
                              M Offline
                              Mark_Wallace
                              wrote on last edited by
                              #28

                              Because by the time you've got through:

                              Dim A as String
                              A = "M"
                              A = A & "a"
                              A = A & "r"
                              A = A & "i"
                              A = A & "j"
                              A = A & "u"
                              A = A & "a"
                              A = A & "n"
                              A = A & "a"

                              You're strung out.

                              I wanna be a eunuchs developer! Pass me a bread knife!

                              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!

                                R Offline
                                R Offline
                                Rob Grainger
                                wrote on last edited by
                                #29

                                Wikipedia[^] tldr; A string is a mathematical concept - a string of "things". In computer science, these "things" are usually characters, so common usage has led to the situation that confused you.

                                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
                                  Michael Kingsford Gray
                                  wrote on last edited by
                                  #30

                                  'Back in the day, A$ was even pronounced, "A-string."' Absolute intercoursing-bullshit.

                                  D M 2 Replies Last reply
                                  0
                                  • M Michael Kingsford Gray

                                    'Back in the day, A$ was even pronounced, "A-string."' Absolute intercoursing-bullshit.

                                    D Offline
                                    D Offline
                                    DerekT P
                                    wrote on last edited by
                                    #31

                                    Everybody every programmer I knew pronounced it that way. Even professional Fortran and Cobol programmers recognised the convention from their early Basic days. (Who didn't learn programming via Basic?)

                                    M R 2 Replies Last reply
                                    0
                                    • D DerekT P

                                      Everybody every programmer I knew pronounced it that way. Even professional Fortran and Cobol programmers recognised the convention from their early Basic days. (Who didn't learn programming via Basic?)

                                      M Offline
                                      M Offline
                                      Michael Kingsford Gray
                                      wrote on last edited by
                                      #32

                                      I did not learn programming from BASIC, for one. As it has not been invented when I learned programming. Is that a valid answer? I accept your correction that you are not aware of any BASIC programmer who did not pronounce it "that way". But that is not my lookout. I began with FORTRAN, an a CDC6600. I subsequently learned BASIC from its inception, and made a large portion of my long professional career from programming in it. But, I have NEVER heard of this vocalisation until you raised it. I have been a professional FORTRAN programmer since 1973, and a COBOL programmer since 1975. Yet I do not recognise this so-called 'convention' in one fraction of an iota. Not with me, nor any of my compartriates. Strange, that. I still call "bovine faeces".

                                      D P 2 Replies Last reply
                                      0
                                      • R Roger Wright

                                        Here, this[^] may help...

                                        Will Rogers never met me.

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

                                        On order thanks.

                                        VS2010/Atmel Studio 6.0 ToDo Manager Extension
                                        Version 3.0 now available. There is no place like 127.0.0.1

                                        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!

                                          E Offline
                                          E Offline
                                          englebart
                                          wrote on last edited by
                                          #34

                                          The next project I start or join on the "ground floor" will ban String/Text as a datatype. Everything declared as a String could and should have a more descriptive data type. Which API is more descriptive? assign(String, String) OR assign(EmployeeId, DepartmentId)

                                          A 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