![]() If a pair commits code that's legitimately unreadable, it is a call to reassess our hiring policies, writ large. ![]() I continue to draw countless lessons from the time I spent working at Pivotal, where the Tracker team established the code-formatting rule: If they were working in a new environment where such spacing was no longer reasonable, or if there was a better standard of spacing in their own environment, I maintain that you (or the colleague who pointed it out to you) found yourself at the crux of a teaching opportunity as opposed to the heart of a war-invoking, crucial difference in the ways different people see the world we share. My inkling is that the developer who had that rule was either not using a lot of tabs, using a screen a few more than 80 characters wide, or had some other environmental rationale for why they had adopted what seems, to you and I, an exorbitant amount of spacing for our specific environments. Or how about 1 tab = 12 spaces, on an 80 character wide screen? Yeah, that was a thing. The terminal software automatically adds an LF to it Like comment: Like comment: 11 likes Hitting the Enter key produces just the CR control character. So in the olden days CRLF was a safer choice to control a teletypewriter.ĪFAIK CRLF is still the full control sequence that is internally used by modern consoles and terminal emulators for moving the text cursor on the screen to the beginning of the next line. ![]() The makers of Unix on the other hand decided that LF would be enough to tell a device driver to send the correct control sequence for moving to the beginning of the next line. They needed CR and LF for doing the right thing. Windows got it from MS-DOS to stay backwards-compatible and MS-DOS got it from CP/M, an OS from the 1970ies, and overall this is how TTYs worked. It was not really a Windows choice or invention. Another LF (line feed) control character was necessary for moving the paper to the next line. CR (carriage return) would tell the device to move the carriage (or print head or whatever) back to the beginning of the current line. Those line ending characters used to be control characters for teletypewriters (TTY). Well, if you have prettier enabled and the endOfLine property is set to lf. To the naked eye the content will look the same, so why should we bother? On the Windows machine the default for the line ending is a Carriage Return Line Feed ( CRLF), whereas on Linux/MacOS it's a Line Feed ( LF). Not all developers are the same, just because you develop on a Windows machine using Visual Studio Code, don't expect the next pull request to have been implemented using the same dev environment (MacOS machine using Sublime Text 2).Īs mentioned above the developers are using different OSes (Windows and MacOS) the default for the line ending will differ. This article will now dive deeper into how to configure the line endings, so every developer uses the same value when using different machines / OSes across the repository. One of these attributes is the eol (end of line) and is used to configure the line endings for a file. In other words git automatically saves the file according to the attributes specified, every time a file is created or saved. gitattributes file allows you to specify the files and paths attributes that should be used by git when performing git actions, such as git commit, etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |