Today I went hunting in an XML file for an erroneous double space I knew was there.
I was horrified to see all those extra spaces there!!! Now this Visual Studio 2010 instance is just running the default setup with the productivity tools installed (Oh and I hit Ctrl+R, Ctrl+W to show the whitespace characters used)
That’s an 81KB XML file!
Now I’m a believer in tabs over spaces and full tab sized indents in all cases, to me it’s cleaner and reduces page weight.
So, open up Visual Studios options, Tools > Options and go to Text Editor > All Languages > Tabs. For me this is what I found….
Settings that were not consistent across all the file types and Spaces used as indents! Grrrr!!!!! So, a quick change of settings:
A quick Ctrl+A, Ctrl+K, Ctrl+F to re-format the file and things looks much tidier:
The file size came down to 80KB, so about a 1.25% savings, not a huge amount, but if you think about that over all of the code sitting in source control for a development company like ours that’s likely to be gigabytes worth of savings. Plus the double space in the file stood out nice and clearly!
Now that the preferences for VS are ‘fixed’ all of the files will get the ugly space based whitespace removed as they get worked on.