What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

Scrolling horizontally is hard. Warning someone that posts code that is larger than 80 characters against the readability problem this causes would be a solution to avoid then from the start.

share|improve this question
We already have a question preview area that shows things fairly faithfully. What kind of additional warning are you proposing? –  Pops Nov 29 '11 at 19:38
Having trouble in your CRT terminal? –  Marcelo Nov 29 '11 at 19:42
-1, 80 is maximum including tab 4 character in linux kernel development. so that per line you read less (put more attention, what u just readed) but vertically read more. –  YumYumYum Nov 29 '11 at 19:43
@PopularDemand : a non modal message, something that warns, or at least, notices. –  greg0ire Nov 29 '11 at 19:49
@Marcelo: "lol" –  greg0ire Nov 29 '11 at 19:49
@PopularDemand: One could also imagine a two-limit system, like phpcodesniffer does : 80 characters => notice; 150 characters => warning –  greg0ire Nov 29 '11 at 19:57
I'd rather see some way to open a code block in some much wider popup. (Or maybe some copy code option.) But I agree: on systems that do not show scrollbars unless one is scrolling (like mobile devices, or like OS X Lion's default settings) I dislike scrolling code even more. –  Arjan Nov 29 '11 at 21:52
@Arjan: that's also a good solution, but it's something that could be done too, not instead of. –  greg0ire Nov 29 '11 at 22:00
@Google: You downvote me, and then you say something that seems to argue in favor of what I'm saying (though I'm not sure I understand what you put between brackets) –  greg0ire Nov 29 '11 at 22:01
add comment

2 Answers

Ow Ow Ow.

I have a cramp from scrolling horizontally....

Yes I am being facetious.

How is it so hard to scroll horizontally?

If the code is that long, that is what will happen, I see no reason to discourage it unless it makes it so that you cannot read the code.


But if you take that above sentence and put it like this:

 If the code is that long, that is what will happen, I see no reason to discourage it unless it makes it so that you cannot read the code.

YES it is very uneasy to read.

In that situation I would discourage the post, but how is the system to know the difference between that and:

  function areallyreallylongfunctionnamethattakesupawholelinewhichisbadpracticebutitistheopscode(){
share|improve this answer
Well, if it's just a warning, the system doesn't have to distinguish between them. –  Richard JP Le Guen Nov 29 '11 at 19:42
If you have such method names, then you have a problem: perhaps your class has too much methods in it. –  greg0ire Nov 29 '11 at 19:47
Note that some systems only show scrollbars while actually scrolling. Like when using Mac OS X Lion's default settings, one has no real indication that something is scrollable. (Apart from the text being cut off, if applicable. On Macs I use, I set the scrollbars to be always visible.) Also some tablets behave like that, though the mobile theme tries to outsmart those by wrapping code blocks. –  Arjan Nov 29 '11 at 21:56
add comment

The number of characters at which horizontal scroll bars are produced is not universal. See:

What is the average number of characters in a Code block before scroll bars appear?

Since I asked that question I am using a different system, and now the max char width does not change with zoom, but it is still nonstandard (currently 87 characters).

share|improve this answer
And on the mobile theme, things are even more different. –  Arjan Nov 29 '11 at 19:57
Still, I think there should be a limit, and the norm seems to be 80 characters. –  greg0ire Nov 29 '11 at 20:04
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .