the_website icon indicating copy to clipboard operation
the_website copied to clipboard

maximum line length in code snippets

Open Xeverous opened this issue 4 years ago • 2 comments

The website has no strong reasons not to be mobile friendly so there should be some line length limit.

  • The limit should exist because:
    • horizontal scrolling of code is very disliked
    • code wrapped through CSS will look bad
  • The limit can be verified through code highliger plugin

The trouble is in figuring out best possible limit.

Xeverous avatar Jun 06 '21 23:06 Xeverous

If we are talking about C++, 80 characters is pretty standard.

Polo123456789 avatar Jun 07 '21 19:06 Polo123456789

I would really question that. We no longer have 4:3 monitors with fixed-size terminals. IIRC I have seen some people on CppCon saying it's a really archaic rule - 120 and even 150 are quite frequent limits in today's projects.

And regardless of this - I'm not interested in the practice, I'm more interested in "how much characters per line can you fit with reasonable font size on the smallest device possible that is used to read this website".

Xeverous avatar Jun 07 '21 23:06 Xeverous