I’m a bit of a sucker for tidy code, so I like to have everything indented and flowing, if you know what I mean.
private void myFunc()
{
while(true)
{
//do this
}
}
etc. Now, I know that in a text file, the tab character or four spaces or whatever is actually stored in there, ready for the next time I open it.
If I go to compile this though, am I going to see any benefit in output filesize / compilation performance by not having tidy formatting and indentation, or does the compiler just ignore everything that isn’t important?
One of the compilation steps is known as tokenization. This step removes all of the whitespace and comments from your code. As long as your code parses correctly, there’s no difference between well formatted or poorly formatted code in terms of runtime speed.