I also like to trim spaces. There are no technical requirements for this, but it has some advantages:
- Scrolling spaces in many editors is annoying when the cursor changes lines, as you may find yourself in the βend white spaceβ of the line when you move from a longer to a shorter line, requiring additional keystrokes to get to the part you want to change
- This can cause your editor to show a horizontal scrollbar that would otherwise not be needed, which in turn forces you to scroll to the right to make sure that the text is missing.
However, first of all, there is a huge advantage (IMHO) to use sequential formatting throughout the source code (spacing, indentation, brace style ...). This simplifies the reading of the code and avoids the big differences from reformattings (if it is always correctly formatted, no need to reformat).
Therefore, I would recommend allowing formatting to start automatically every time it is saved (or at least for every commit). Thus, the final gap can be excluded as a side effect :-).
sleske
source share