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. CRLF is Wrong???

CRLF is Wrong???

Scheduled Pinned Locked Moved The Lounge
questiondiscussion
17 Posts 12 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.
  • I Offline
    I Offline
    i00
    wrote on last edited by
    #1

    I always knew that the CRLF came from Carriage Return and Line Feed from the days of the electronic typewriters ... but never really thought about it logically until today... In the days of electronic typewriters a Line Feed would be followed by a Carriage Return to move the line down and the return the carriage to the start of the line I have [B]never[/B] seen a typewriter do it the other way around... so why is this reversed in computing?? ... even the enter character symbol ↵ implies that the Line Feed should be done first!... I even looked up YouTube videos to double check ... and sure enough the LineFeed is done first :) Any thoughts ;P?? ... Do people agree that logically it should be done the other way around (although I would be against that since I have been conditioned to do it the other way)?? Kris

    P J P Kornfeld Eliyahu PeterK M 6 Replies Last reply
    0
    • I i00

      I always knew that the CRLF came from Carriage Return and Line Feed from the days of the electronic typewriters ... but never really thought about it logically until today... In the days of electronic typewriters a Line Feed would be followed by a Carriage Return to move the line down and the return the carriage to the start of the line I have [B]never[/B] seen a typewriter do it the other way around... so why is this reversed in computing?? ... even the enter character symbol ↵ implies that the Line Feed should be done first!... I even looked up YouTube videos to double check ... and sure enough the LineFeed is done first :) Any thoughts ;P?? ... Do people agree that logically it should be done the other way around (although I would be against that since I have been conditioned to do it the other way)?? Kris

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

      And? (Later...) As we're talking about computing history, also consider FORTRAN -- what did it use? As I recall the first character (or was it two?) on a line indicated what to do after the Carriage Return. The discussions always allude to which system you're on, but then only mention Windows, Apple, and UNIX -- which leaves out OpenVMS, which is like totally flexible! You want CR? You got it. You want LF? You got it. You want Fortran? You got it. You want Fixed format? What size? Also, in one of the posts someone pointed to, I saw this:

      Someone wrote:

      it was often the "style" to have normal print lines begin with Line Feed and end with Carriage Return

      That's how I prefer to read "lines" from text files -- so I know I got the whole thing.

      J 1 Reply Last reply
      0
      • I i00

        I always knew that the CRLF came from Carriage Return and Line Feed from the days of the electronic typewriters ... but never really thought about it logically until today... In the days of electronic typewriters a Line Feed would be followed by a Carriage Return to move the line down and the return the carriage to the start of the line I have [B]never[/B] seen a typewriter do it the other way around... so why is this reversed in computing?? ... even the enter character symbol ↵ implies that the Line Feed should be done first!... I even looked up YouTube videos to double check ... and sure enough the LineFeed is done first :) Any thoughts ;P?? ... Do people agree that logically it should be done the other way around (although I would be against that since I have been conditioned to do it the other way)?? Kris

        J Offline
        J Offline
        Jeremy Falcon
        wrote on last edited by
        #3

        Wow, never really thought about it. Turns out that SO knows everything though... Order of carriage return and new line feed[^]

        Jeremy Falcon

        1 Reply Last reply
        0
        • I i00

          I always knew that the CRLF came from Carriage Return and Line Feed from the days of the electronic typewriters ... but never really thought about it logically until today... In the days of electronic typewriters a Line Feed would be followed by a Carriage Return to move the line down and the return the carriage to the start of the line I have [B]never[/B] seen a typewriter do it the other way around... so why is this reversed in computing?? ... even the enter character symbol ↵ implies that the Line Feed should be done first!... I even looked up YouTube videos to double check ... and sure enough the LineFeed is done first :) Any thoughts ;P?? ... Do people agree that logically it should be done the other way around (although I would be against that since I have been conditioned to do it the other way)?? Kris

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

          Having cut my teeth on teleprinters (Yes, I have stripped an ASR-33[^] and reassembled it from a bucket of sheet metal stampings :-O ) I can tell you that CRLF is right, LFCR is wrong. The reason for this is that the carriage return is SLOW. But it can be overlapped with the paper feed. Back in the day, most software would output "CR LF PAD PAD" to be safe. It took a bit of tuning of the dashpot to get an ASR-33 carriage to have finished bouncing with just CR LF , but it could be done. The Siemens equivalent (which made a sexy purring noise, unlike the skeletons-copulating-on-a-tin-roof of the model 33) needed the pads, otherwise the first character of the next line would print "somewhere", generally blurred as the carriage was moving. Cheers, Peter

          Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

          M K D J 4 Replies Last reply
          0
          • P Peter_in_2780

            Having cut my teeth on teleprinters (Yes, I have stripped an ASR-33[^] and reassembled it from a bucket of sheet metal stampings :-O ) I can tell you that CRLF is right, LFCR is wrong. The reason for this is that the carriage return is SLOW. But it can be overlapped with the paper feed. Back in the day, most software would output "CR LF PAD PAD" to be safe. It took a bit of tuning of the dashpot to get an ASR-33 carriage to have finished bouncing with just CR LF , but it could be done. The Siemens equivalent (which made a sexy purring noise, unlike the skeletons-copulating-on-a-tin-roof of the model 33) needed the pads, otherwise the first character of the next line would print "somewhere", generally blurred as the carriage was moving. Cheers, Peter

            Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

            M Offline
            M Offline
            Mycroft Holmes
            wrote on last edited by
            #5

            Peter_in_2780 wrote:

            unlike the skeletons-copulating-on-a-tin-roof

            I play clash of clans (skeletons are one of the participants) and I am not going to be able to get that image out of my head. Hordes of skeletons racing at each other and start shagging AAaaaaaahhhhhhh

            Never underestimate the power of human stupidity RAH

            P P L 3 Replies Last reply
            0
            • M Mycroft Holmes

              Peter_in_2780 wrote:

              unlike the skeletons-copulating-on-a-tin-roof

              I play clash of clans (skeletons are one of the participants) and I am not going to be able to get that image out of my head. Hordes of skeletons racing at each other and start shagging AAaaaaaahhhhhhh

              Never underestimate the power of human stupidity RAH

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

              :laugh: :laugh: :laugh:

              Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

              1 Reply Last reply
              0
              • I i00

                I always knew that the CRLF came from Carriage Return and Line Feed from the days of the electronic typewriters ... but never really thought about it logically until today... In the days of electronic typewriters a Line Feed would be followed by a Carriage Return to move the line down and the return the carriage to the start of the line I have [B]never[/B] seen a typewriter do it the other way around... so why is this reversed in computing?? ... even the enter character symbol ↵ implies that the Line Feed should be done first!... I even looked up YouTube videos to double check ... and sure enough the LineFeed is done first :) Any thoughts ;P?? ... Do people agree that logically it should be done the other way around (although I would be against that since I have been conditioned to do it the other way)?? Kris

                Kornfeld Eliyahu PeterK Offline
                Kornfeld Eliyahu PeterK Offline
                Kornfeld Eliyahu Peter
                wrote on last edited by
                #7

                You are going a bit too far back - typewrites done the LF/CR thing using human control (hand) so there were no input until the movement done. But! with teleprinters (electronically controlled) the data flows in without interruption, but the mechanical movement of the printing head still there, so the only proper form is CR/LF... The reason is that the printing head need more time to travel back to the beginning of the page than the time it takes to print a letter. That time bought by the processing of LF...

                Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

                "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                1 Reply Last reply
                0
                • M Mycroft Holmes

                  Peter_in_2780 wrote:

                  unlike the skeletons-copulating-on-a-tin-roof

                  I play clash of clans (skeletons are one of the participants) and I am not going to be able to get that image out of my head. Hordes of skeletons racing at each other and start shagging AAaaaaaahhhhhhh

                  Never underestimate the power of human stupidity RAH

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  I never knew that boning had such a literal meaning.

                  M 1 Reply Last reply
                  0
                  • P Pete OHanlon

                    I never knew that boning had such a literal meaning.

                    M Offline
                    M Offline
                    Mycroft Holmes
                    wrote on last edited by
                    #9

                    Groan...

                    Never underestimate the power of human stupidity RAH

                    1 Reply Last reply
                    0
                    • M Mycroft Holmes

                      Peter_in_2780 wrote:

                      unlike the skeletons-copulating-on-a-tin-roof

                      I play clash of clans (skeletons are one of the participants) and I am not going to be able to get that image out of my head. Hordes of skeletons racing at each other and start shagging AAaaaaaahhhhhhh

                      Never underestimate the power of human stupidity RAH

                      L Offline
                      L Offline
                      Lockwood
                      wrote on last edited by
                      #10

                      A whole new meaning to the term "boning"

                      1 Reply Last reply
                      0
                      • I i00

                        I always knew that the CRLF came from Carriage Return and Line Feed from the days of the electronic typewriters ... but never really thought about it logically until today... In the days of electronic typewriters a Line Feed would be followed by a Carriage Return to move the line down and the return the carriage to the start of the line I have [B]never[/B] seen a typewriter do it the other way around... so why is this reversed in computing?? ... even the enter character symbol ↵ implies that the Line Feed should be done first!... I even looked up YouTube videos to double check ... and sure enough the LineFeed is done first :) Any thoughts ;P?? ... Do people agree that logically it should be done the other way around (although I would be against that since I have been conditioned to do it the other way)?? Kris

                        M Offline
                        M Offline
                        MadMyche
                        wrote on last edited by
                        #11

                        While I learned how to type on a Selectric in high school, at home I was relegated to a portable mechanical typewriter which was early 60s vintage. The mechanics of the carriage return would behave differently depending on both the location and force applied to the lever. If you were light of touch or applied the force towards the pivot point the CR would be first. If you were heavy handed towards the front end of the return lever the LF would have occurred first. I suppose I could track down which of my older sisters still has this museum piece to do a follow up investigation... Maybe CR becomes before LF due to the alphabetics of the code names? I don't know how well my rote knowledge would take to relearning the 0a-0d sequence


                        Director of Transmogrification Services Shinobi of Query Language Master of Yoda Conditional

                        1 Reply Last reply
                        0
                        • P Peter_in_2780

                          Having cut my teeth on teleprinters (Yes, I have stripped an ASR-33[^] and reassembled it from a bucket of sheet metal stampings :-O ) I can tell you that CRLF is right, LFCR is wrong. The reason for this is that the carriage return is SLOW. But it can be overlapped with the paper feed. Back in the day, most software would output "CR LF PAD PAD" to be safe. It took a bit of tuning of the dashpot to get an ASR-33 carriage to have finished bouncing with just CR LF , but it could be done. The Siemens equivalent (which made a sexy purring noise, unlike the skeletons-copulating-on-a-tin-roof of the model 33) needed the pads, otherwise the first character of the next line would print "somewhere", generally blurred as the carriage was moving. Cheers, Peter

                          Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

                          K Offline
                          K Offline
                          kmoorevs
                          wrote on last edited by
                          #12

                          :thumbsup: Thanks for this excellent explanation! :)

                          "Go forth into the source" - Neal Morse

                          1 Reply Last reply
                          0
                          • P Peter_in_2780

                            Having cut my teeth on teleprinters (Yes, I have stripped an ASR-33[^] and reassembled it from a bucket of sheet metal stampings :-O ) I can tell you that CRLF is right, LFCR is wrong. The reason for this is that the carriage return is SLOW. But it can be overlapped with the paper feed. Back in the day, most software would output "CR LF PAD PAD" to be safe. It took a bit of tuning of the dashpot to get an ASR-33 carriage to have finished bouncing with just CR LF , but it could be done. The Siemens equivalent (which made a sexy purring noise, unlike the skeletons-copulating-on-a-tin-roof of the model 33) needed the pads, otherwise the first character of the next line would print "somewhere", generally blurred as the carriage was moving. Cheers, Peter

                            Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

                            D Offline
                            D Offline
                            dandy72
                            wrote on last edited by
                            #13

                            Peter_in_2780 wrote:

                            skeletons-copulating-on-a-tin-roof

                            Made my day. :-D

                            1 Reply Last reply
                            0
                            • I i00

                              I always knew that the CRLF came from Carriage Return and Line Feed from the days of the electronic typewriters ... but never really thought about it logically until today... In the days of electronic typewriters a Line Feed would be followed by a Carriage Return to move the line down and the return the carriage to the start of the line I have [B]never[/B] seen a typewriter do it the other way around... so why is this reversed in computing?? ... even the enter character symbol ↵ implies that the Line Feed should be done first!... I even looked up YouTube videos to double check ... and sure enough the LineFeed is done first :) Any thoughts ;P?? ... Do people agree that logically it should be done the other way around (although I would be against that since I have been conditioned to do it the other way)?? Kris

                              J Offline
                              J Offline
                              jschell
                              wrote on last edited by
                              #14

                              i00 wrote:

                              so why is this reversed in computing??

                              One reason I could suggest is because the CR by itself is useful. If one wants to 'bold' something one does a CR and then spaces out to where the bold word should be, then types the bold word again (so on top of the existing one) and then one could either do another bold word (same process) or do an immediate CRLF. Alternatively an LF by itself, arbitrarily in the middle of a line wasn't useful. Especially because if an LF was done in the middle of a line and that was the last output in the block and another block, some where else in the app, needs to print then it doesn't know where to start printing. This lead to things like always putting a CRLF at the beginning just to be sure that one 'knew' that it was at the beginning of a line and on a fresh line. So basically CR was more important than LF. [UPDATE:] Still like my guess but after reading other responses and checking my fuzzy memory I agree it was probably speed of operation between the two.

                              1 Reply Last reply
                              0
                              • P PIEBALDconsult

                                And? (Later...) As we're talking about computing history, also consider FORTRAN -- what did it use? As I recall the first character (or was it two?) on a line indicated what to do after the Carriage Return. The discussions always allude to which system you're on, but then only mention Windows, Apple, and UNIX -- which leaves out OpenVMS, which is like totally flexible! You want CR? You got it. You want LF? You got it. You want Fortran? You got it. You want Fixed format? What size? Also, in one of the posts someone pointed to, I saw this:

                                Someone wrote:

                                it was often the "style" to have normal print lines begin with Line Feed and end with Carriage Return

                                That's how I prefer to read "lines" from text files -- so I know I got the whole thing.

                                J Offline
                                J Offline
                                jschell
                                wrote on last edited by
                                #15

                                PIEBALDconsult wrote:

                                As I recall the first character (or was it two?) on a line indicated what to do after the Carriage Return.

                                As I recall... Punch cards probably varied but the first 6 chars were for the line number. Then the continuation character in the 7th position. And it was on the line that was continuing, not on the first line.

                                1 Reply Last reply
                                0
                                • P Peter_in_2780

                                  Having cut my teeth on teleprinters (Yes, I have stripped an ASR-33[^] and reassembled it from a bucket of sheet metal stampings :-O ) I can tell you that CRLF is right, LFCR is wrong. The reason for this is that the carriage return is SLOW. But it can be overlapped with the paper feed. Back in the day, most software would output "CR LF PAD PAD" to be safe. It took a bit of tuning of the dashpot to get an ASR-33 carriage to have finished bouncing with just CR LF , but it could be done. The Siemens equivalent (which made a sexy purring noise, unlike the skeletons-copulating-on-a-tin-roof of the model 33) needed the pads, otherwise the first character of the next line would print "somewhere", generally blurred as the carriage was moving. Cheers, Peter

                                  Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

                                  J Offline
                                  J Offline
                                  jschell
                                  wrote on last edited by
                                  #16

                                  Peter_in_2780 wrote:

                                  The reason for this is that the carriage return is SLOW. But it can be overlapped with the paper feed.

                                  Seems like I recall hearing an explanation like that. From experience I know LF is 'fast'. Fast enough that one could make the paper basically shoot up like a fountain from the TTY33. Operators really loved it when the users discovered that and how to send messages to the operators.

                                  P 1 Reply Last reply
                                  0
                                  • J jschell

                                    Peter_in_2780 wrote:

                                    The reason for this is that the carriage return is SLOW. But it can be overlapped with the paper feed.

                                    Seems like I recall hearing an explanation like that. From experience I know LF is 'fast'. Fast enough that one could make the paper basically shoot up like a fountain from the TTY33. Operators really loved it when the users discovered that and how to send messages to the operators.

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

                                    Yeah, FF (form feed) and VT (vertical tab) could spit paper fast. The basis of several pranks.

                                    Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

                                    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