10

I am building a game in Unity, and I am using Visual Studio 2013 as my default IDE. Whenever I create a file, it asks me if I want to normalize the line endings because the are not consistent (details on that here: What does Visual Studio mean by normalize inconsistent line endings?).

Should I say yes or no?

My best guess would be that if I say "Yes", it will clean up the Mac and Linux stuff that Windows doesn't care about, so it will only run on Windows. My best guess for choosing "No" is that it will keep the code to run on each of all three platforms without affecting the other two. Is this correct?

3
  • 1
    Clicking "Yes", will alter all line endings, but may cause incompatibilities when not compiling on a Windows based system. Clicking "No", will do nothing, and it will leave any incorrect/inconsistent line endings alone; which may or may not compile on other systems. TLDR; If you intend to compile only on Windows click Yes, otherwise click No. Commented May 14, 2014 at 0:16
  • i intend for the game to run on windows, mac, and linux. any suggestions on which to select for that?
    – Evorlor
    Commented May 14, 2014 at 0:22
  • 1
    It will have little affect on where you intend to have the game run (worst case scenario it may produce odd stack traces) The line endings only matter for the compiler. If you compile the game on Linux/Mac, then you will need line endings that are compatible with both. Once the game is compiled/built line endings no longer matter. Commented May 14, 2014 at 1:03

2 Answers 2

16

Is there a chance that you will switch between IDEs and/or operating systems while working on the project or are you working with other people?

If so you need to care about the line endings of your project files and it might be a bad idea to change them because other IDEs may not be able to understand them. However having that message popping up every time you open a file can be a pain in the @ss. You can toggle this behaviour going to:

Tools -> Options -> Documents -> Check for consistent line endings on load

If not you can change them and you will have no problems wherever the platform the game will run. I only use Visual Studio 2013 w/ Windows 8.1 when working with Unity and I normalize line endings every time. I never had a problem with it even when running the game in different platforms. I guess it can only affect the code editors and the compiler tools. After the compilation line endings do not matter anymore.

1
  • 1
    Re "it might be a bad idea to change them": Do you understand that this message only happens if the line endings are inconsistent within a file? That is, a text file in which some lines end with (LF only), and other lines end with (CrLf). The only time saying "Yes" will cause problems, is if you have a (IMHO rare) situation where the text needs to be mixed. For example, your sources need to be (CrLf), but you have a text string that needs to be (LF only). Its a different topic whether one should pick something other than the default option of Windows (CrLf), when normalizing. Commented Oct 24, 2016 at 17:36
0

For most use cases it doesn't really matters. Chances are that you will use either VS or MonoDevelop. Both can handle different line endings. It only matters if you are intending to use some editor which is sensible to line endings style.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.