Do you prefer windows or a unix line for code?

I am writing code that should compile and run on both Windows and UNIX, such as Linux. I know about the difference between line endings, but the question is which one prefers for my code? Does it matter? I want it to be consistent - let's say all my code uses only LF or better is CRLF? Are there critical evaluations for comparison?

If that matters, I mostly care about C ++ and Python codes

+4
source share
3 answers

Use a version control system that is smart enough to ignore line endings during registration and use the correct value for the platform when leaving.

+9
source

For the code itself, this does not matter. All reasonably modern editors and compilers do just as well (I suppose you're not using notepad :-)). Just use the line ending of the main development platform.

+2
source

IME is easiest to use * NIX line endings. Windows and IDE compilers can handle this well, and they are native to NIX * tools. Using DOS line endings creates, if not problems, inconvenience with some (even more popular) * NIX text editors. You often get the ugly “^ M” at the end of a line, and you must explicitly convert or tell your editor that he is running out of DOS lines.

+2
source

All Articles