3 ms·
I never understand how people can even argue that uniform style is necessary, you have to dig into 3rd party code with different styles every day anyway. And i
by the8472 8y ago
I never understand how people can even argue that uniform style is necessary, you have to dig into 3rd party code with different styles every day anyway.
And imo autoformatters are too inflexible. Most default rules are ok when you don't make any effort about formatting at all but break down when you manually lay out things for improved readibility. E.g. when splitting arguments to one arg per line and parens on separate lines and the autoformatter will just go and squash them all together into single lines up to the line limit, except the lambda in the middle which will be broken out into a separate line. Or other fun things like that.
Formatters which rearrange code by alphabetical sorting or sorting by visibility are even worse. They can introduce so much commit noise just because you change an identifier.
- 0db532a0 8y agogit diff -C can show rearrangements and renames.
- the8472 8y agoit still pollutes the git blame, doesn't help with web views of code repos and causes more merge/rebase conflicts. the sorting causes more problems than its very questionable worth.
- 0db532a0 8y agoSetting the git diff algorithm to patience or histogram would probably solve a lot of the merge issues. You’re right on the web views. It would be nice if they respected the algorithm setting from the git config.
- the8472 8y agoIn my experience the diff algorithms do nothing when one person moves the function and another edits it. The algos just fiddle around the margins of diff hunks.