Why I'm skeptical of auto-formatting

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Fri May 3 03:40:32 UTC 2019


I never use auto-formatting for pretty much the same reason:

All rules (including this one) have exceptions. And automatic 
enforcement of any set of rules is inherently incapable of handling 
reasonable exceptions. In other words: There must ALWAYS be a "manual 
override".

It's a perfect example of rigid idealism (barf!) vs basic pragmatism.

That said, I do like *some* (though not many) minor formatting things 
that modern editors can help with: Like when I hit "Enter", and it 
automatically indents the new line the same as the previous. But that 
works only because it's only a spur-of-the-moment suggestion, not a tool 
that's meant to override me. (And frankly, *most* editor attempts at 
"helping" me are things I regard as some other person randomly taking my 
keyboard and presumptively screwing around with what I'm doing, such as 
auto-indenting a whole block when I type '}' or auto-inserting a '}'. I 
can TOTALLY understand why some people would like that stuff, but it 
completely breaks my muscle memory.)

Auto-format is for *exactly* two situations:

A. Cleaning up messy externally-developed code so you can read it your 
own preferred way.

B. Tolerating incompetent team members who are SOOO bad at what they're 
doing that it's worthwhile to sacrifice some formatting freedom so the 
idiots on the team will no longer screw up the basic style guidelines so 
badly, on such a regular basis.


More information about the Digitalmars-d mailing list