Possible Duplicate:
Resizable text blocks?

I find reading wide code snippets using horizontal scrollbars annoying. Sometimes I have to scroll back and forth when reading multiple wide lines of code.

How about displaying these using larger text boxes?

(Let the textbox overlay the Similar Question column if necessary.)

New suggestions:

1- Make it a per user setting that the user wants wide code to expand the text box (and user doesn't care if it overlays the right column)

2- Make the textbox wider when the user hovers over it with the mouse or clicks a link to expand it on demand. This can happen only if box contains wide lines of code.

2- Sniff the user's screen resolution and adjust the page's columns' widths according. I see too much wasted white space on both sides on my wide monitor (Why do I have to see that weird bouncy search box trying to widen itself when I have a ton of space on both side on that bar!?) I believe this should be in place just as a standard. HTML 5's media queries can be used for this.


2 Answers 2


I don't think that overlaying the "Similar Questions" list is a good solution, that makes the site look broken. A better solution would be to simply widen the question/answer column, i.e, to make

#mainbar {
    width: 735px;

a dynamic calculation, and give those of us with larger monitors a little more room. The site is currently optimized for a 960-pixel width, so that it displays properly on 1024-pixel wide monitors. Some smartphones have 4" 1024-pixel displays these days, and most of the readers of this site have bigger monitors than average anyways. Jeff writes a lot of blog posts about the value of screen real estate, but then encumbers the website by limiting the content to 735 pixels wide! What gives?

Here's a sample code block on which to test the scrollbars:

        1         2         3         4         5         6         7         8         9        10        11        12

and here's what that text looks like on my 1920-pixel wide monitor:

enter image description here

That little blotch of grey in the middle is the text. It's scaled down to 640 pixels, because that's the maximum width of an image on the site.

I should not have to scroll this text box horizontally to reveal all 120 characters. 80-character terminals are history, widescreen LCD flatpanel displays of 20" or greater are the new standard. Most people have at least 1440, if not 1600 or 1920 pixels of horizontal screen space. Of course, this would be a pretty big change for Stack Exchange to make the sites dynamically resizeable. But that's what would have to happen for this to be done right.

  • See my new suggestions Commented Jan 6, 2012 at 5:16

The current setup gives us about 80 columns of text. This is fine for C, where convention and history conspire to keep line lengths relatively short. This is fine for most functional programming languages, where nested indents are relatively rare. It's horrible for Objective-C. (I don't think Objective-C allows method names or parameter names to be shorter than 20 characters...)

I go to some effort to reformat code to remove the hateful horizontal scrollbar but I don't even bother with Objective-C code any more because it looks so foreign to the Objective-C idiom.

Incidentally, I dislike the code-region vertical scrollbar too -- but I have full-blown nerd-rage at the horizontal scrollbar.

  • There are similar posts in meta about not wanting to reformat the code or what if there's a variable or method name that's very long? You don't want to chop it. Commented Jan 6, 2012 at 5:06
  • That's true too -- though an 80+ column variable or method name needs changing in the original source, too. :) I find that most of my reformatting is just re-arranging comments. Annoying.
    – sarnold
    Commented Jan 6, 2012 at 5:08

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