Hacker News new | ask | show | jobs
by steve_taylor 583 days ago
Prettier docs recommend a line length of 80 characters because of a fundamental design flaw: Lines are greedy and cramming as much as possible into each line decreases readability as lines increase in size.
1 comments

Yesterday I was running Prettier on an existing code base, and decided to go with 100. Even at 2-space indentation, 80 caused too many if-expressions to be split up. Google's JS styleguide also says 80. (I also have 450 character lines there, in a table of CSS classes for dark/light/selected/hover/disabled/focused modes. Leaving it long makes it much easier to confirm all modes set the right class.)

However, the benefit of automatic formatters is that if you really like 80 better, you can reformat before editing, and undo that before sharing your results.