1. While you are in the middle of writing your file the first time.
2. When your IDE/editor doesn't see all the includes/imports
3. In languages where syntactic validity depends on semantics, beyond merely known and unknown identifiers.
4. When you make a syntax errors. Which is all the time, basically, until you've gotten your program or library to compile.
5. When you choose to format just a small segment of code, not the whole file.
1. While you are in the middle of writing your file the first time.
2. When your IDE/editor doesn't see all the includes/imports
3. In languages where syntactic validity depends on semantics, beyond merely known and unknown identifiers.
4. When you make a syntax errors. Which is all the time, basically, until you've gotten your program or library to compile.
5. When you choose to format just a small segment of code, not the whole file.