So, at work I've just been using the default settings on Visual Studio to determine my brace style and indent style. To my surprise I've found the spaces vs. tabs issue far more important than having my code look "double spaced" with braces on their own lines. For one, ASP.NET doesn't get you very dense or detailed code anyway, so it doesn't matter as much that there are some extra blank lines spacing out the code. The thing that's annoyed me about having leading spaces instead of tabs is that it gets real old real fast having to hit the backspace key four times the number of times I'd have to hit it were I using tabs. Say I hit the tab key an extra time by accident... that's four times I have to hit the backspace key. In fact, that's an extra argument for using tabs I hadn't considered before. A one-to-one correspondence not only between the number of times you hit 'tab' and the number of characters put in the file, but between the number of times you hit 'tab' and the number of times you have to hit 'backspace' to remove that "tab".
Was just reminded of something (code taken from here (linked earlier)). Compared to the following:
public class Point
{
private int x, y;
public Point()
{
x = 0;
y = 0;
}
public int X
{
get
{
return x;
}
set
{
x = value;
}
}
public int Y
{
get
{
return y;
}
set
{
y = value;
}
}
}
Something like the following:
public class Point{
private int x, y;
public Point(){
x = 0;
y = 0;
}
public int X{
get{
return x;
}
set{
x = value;
}
}
public int Y{
get{
return y;
}
set{
y = value;
}
}
}
or particularly the following:
public class Point{
private int x, y;
public Point(){
x = 0;
y = 0;
}
public int X{
get{ return x; }
set{ x = value; }
}
public int Y{
get{ return y; }
set{ y = value; }
}
}
seems so clearly superior to me that I don't see what there is to debate. It's beyond me how anyone would like to read the first version, which is the exact same code as the final version but with 16 extra lines of nothing to wade through. It's almost twice as many lines as the final version.
While I'm here I might as well harp on tabs vs spaces. I'll never understand why some people prefer to only use spaces instead of tabs. Tab means "one level of indentation". Furthermore, some people like to use two spaces to indent their code. That's perfectly fine, but use tabs so I don't have to care about how you like to view your code.
"IMDB for music"
IMDB for Music? It looks to be acouple of years old...http://MusicTell.co...
Ken Empie: May 14, 9:57pm