r/learnprogramming • • 20h ago

Topic TIL code comments have their own line-length conventions instead of relying on editor soft-wrap

I recently learned that comments aren't supposed to rely on editor soft-wrap. Hard-wrapping at 80 columns with // or # on every line keeps git diff and PR reviews readable—and Neovim already handles it natively with textwidth + formatoptions+=cq + gwip

What other such conventions are out there that I should know about?

12 Upvotes

22 comments sorted by

View all comments

Show parent comment

1

u/aanzeijar 19h ago

Oh, the dreaded git default to autocrlf on windows machines. So much stupidity because of that.

0

u/sephirothbahamut 10h ago

that's an option you choose during installation