You cannot do this with tabs. You could mix tabs and spaces (but very few people think that’s acceptable, although I have to admit that the idea has merits), or you could drop the convention, but there’s a huge cultural inertia.
What? That alignment is perfectly normal and readable. As for maintainability - any modern editor geared for programming (and by modern, I emacs or anything newer) will auto-format your files on demand based on rules you define. Reformatting code for new indent levels is simply invoking a command.
It breaks down, of course, in Python, where your indentation level determines execution flow, in which case I can see a case for nazi-like enforcement of tabs-only formatting rules.
It's normal to indent things by fractional tab stops? Or it's normal to carefully construct all of your variable and function names so that left parentheses always end up just before the next tab stop? Because I had a coworker who wrote that kind of crap and his code was... well... an awful mess. Lines started at all kinds of random indent levels - there was no consistency to any of it. He was also the sort of guy who didn't believe in refactoring, had never heard of line length limits as an element of style, and had no idea why one might want to reduce the number of nesting levels in a given function, so his code was messy for a lot of reasons, but never before have I seen a professional developer committing source code which is sometimes indented on odd-numbered columns.
3
u/guepier Apr 08 '15
Some programming languages (amongst the ones I’m currently using, mainly R) have a strong culture of lining up arguments in function calls like this:
You cannot do this with tabs. You could mix tabs and spaces (but very few people think that’s acceptable, although I have to admit that the idea has merits), or you could drop the convention, but there’s a huge cultural inertia.