3 ms·
Or just don't bother with alignment and just use tabs for indentation. For example, instead of aligning function parameters after the opening parenthesis, move
by u801e 9y ago
Or just don't bother with alignment and just use tabs for indentation. For example, instead of aligning function parameters after the opening parenthesis, move them to the next line and use a hanging indent:
someType someFunctionName(
param1, param2, ...)
{
statement1;
statement2;
...
}
I find that following a style like this will work equally well with tabs or spaces and that I have to spend less time formatting code I write (either manually or changing a setting in the editor I'm using).
- nhaehnle 9y agoThis is a very good point, and I agree. No matter how you do it[0], alignment is bad for maintainability. It happens that someType or someFunctionName changes, and if you use alignment, you'll have to re-align all those parameters. This is annoying to do even with editor help, and it generates noisy diffs which make patch review needlessly more difficult. Aligning the names of member variables is even worse. Just Say No to alignment, perhaps? ;) [0] Well, except if you use "elastic tabs", which don't have widespread support in the first place.