Wednesday 19 November 2008

Tabs or Spaces?

Do you use tabs or spaces to indent your code structures? I was a huge fan of spaces but recently had a chance to review code written with tabs visualized in Visual Studio. It looks great! :)

Just try it! To show white spaces in Visual Studio use 'Edit > Advanced > View White Space' menu item. Use 'Edit > Advanced' menu to tabify or untabify selected lines - really cool feature when you are converting your old file to your new religion :)

Don't forget to go to 'Tools > Options > Text Editor > All languages' and check 'Keep tabs' radio. Otherwise next time you'll press the Tab key you'll see four dots instead of one sexy arrow :)

To modify color of visible white spaces use 'Tools > Options > Environment > Fonts and Colors > Display Items > Visible White Space'. Try setting color to make them visible enough though not distracting you with visual noice. As for me, I'm using rgb(34, 114, 134) for my modified Moria theme. Looks like this:



You can see them easily yet concentrating on your markup is easy.

Enjoy :)

No comments: