Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!rochester!ken From: ken@cs.rochester.edu (Ken Yap) Newsgroups: comp.sys.ibm.pc Subject: Re: Trouble compiling flip with TurboC Message-ID: <1989Aug4.043051.14636@cs.rochester.edu> Date: 4 Aug 89 04:30:51 GMT References: <14517@dartvax.Dartmouth.EDU> <45900257@uxe.cso.uiuc.edu> Reply-To: ken@cs.rochester.edu (Ken Yap) Organization: U of Rochester, CS Dept, Rochester, NY Lines: 30 |No, it doesn't, at least for ASCII. In ascii, carriage return and |line feed are separate characters. Ascii terminals require both |to get to the left hand side of a new line. Thus, with the MS-DOS |convention, a text file is a plain file - no translation is necessary |for it to be sent to a terminal. For Unix, text files must be translated |so a lf sends out both a line feed and a carriagereturn - and this |means it is impossible to send out a linefeed alone. | |If ascii had a newline character, then everybody would be the same, |but it doesn't |have that - it has a separate line feed and carriage return. | |C's use of a single newline indicator is an oddity too. Sorry to possibly start a flame war, but the Unix convention makes a lot of sense. To start off, why have outdated notions about what CR and LF do? Those belong to the age of clunky teletypes. What is really needed is a line separator in files. Should it be one character or the CR/LF pair? Why complicate things by using two characters when one will do? One character avoids all questions about what a single LF or a LF/CR pair might mean, as well as making it easy for programs to generate an end of line by sending out one character. Should it be LF or CR? CR is useful for overstriking while LF alone is not useful. So we shouldn't preempt CR. So LF it is. Call it newline. Snag is, terminals have this RETURN key. So do the translation in the terminal driver. It's the only place that needs to translate CR to NL on input and NL to CR/LF on output. Everywhere else NL ('\n') is used. I'm sure either Ken or Dennis went through this argument in their minds when they were designing.