What is the best way to put comments in your code? I see at least three different ways:
1:
int i = 10; //Set i to 10
2:
//Set i to 10
int i = 10;
3:
int i = 10;
//Set i to 10
The disadvantage of using the first method is that many people use tabs instead of spaces, and doing so will cause comments to become severely misaligned when the tab size changes.
The second and third snippets avoid this problem, but when having a lot of code it is sometimes unclear which line a comment is referring to.