In OO languages, at least C#, everything has to be in a class. Sometimes, everything is in a namespace as well.
Just about literally all the code in one class is going to be automatically indented by a tab stop or two, which is seriously pretty pointless if it doesn’t help with code readability.
The issue with just removing the indent on every single line is that the one/two lines that had the “class …” and the “}” become out of place.
What seems like a clean and readable way to remove the extra indents in front of every single line without making the class declarations be weird?
This might be opinion-based but I don’t know.
5
Try setting a tab equal to two spaces. It cuts back on whitespace by a factor of 2.5x, yet it provides more than enough visual feedback.
2
You could leave a blank line between the class declaration and the class body, with the bracket at the end of the line, like so:
class ThisIsAClass {
public void thisIsAFunction {
// Do stuff
}
}
Do as Defenestrator suggested, in leaving a blank line between the class declaration and the first member and also give a comment end braces:
class ThisIsAClass {
public void thisIsAFunction {
// Do stuff
}// end thisIsAFunction
}// end class ThisIsAClass