Hisham is a user on mastodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

I hate the paranoia around trimming trailing whitespace.

I remember a time when people weren't pedantic about it.

It started with Linux kernel devs because of their patches-over-email development method (email lost whitespace)

Then Linus coded that pedantism into Git.

And it spread like wildfire: editors started painting trailing whitespace RED.

Now everyone HATES trailing whitespace and when I ask them why they go blank for a second, then "...because Git and $EDITOR complain about it"

@hisham_hm Actually because it can be the source of line changes that are unimportant. Adding or removing whitespace is irrelevant but will show up as a changed line in git. Therefore, removing whitespace early and sticking to keeping it removed keeps linechanges clean too.

Hisham @hisham_hm

@Gargron Whitespace-only diffs are a different/larger issue from trailing-whitespace.

I don't trim trailing whitespace and I still pay attention to avoid unimportant whitespace-only diffs.

Whitespace diffs can happen whether you trim trailing blanks or not (e.g. when people "align" C-style variable declarations then have to change/add one of them).

· Web · 0 · 0