Scrolling code.

When the number of lines inside a code tag exceed 30 lines it begins to scroll. I think most people find nested scroll bars annoying. Whenever I post code I try my best to fit the code I post to 30 lines or less. Often it takes multiple edits before the scroll bar disappears.

Here's an example : http://www.dev-archive.com/forum/showthread.php?p=1263635#post1263635

I think 30 lines is a bit restrictive, could we increase this slightly? Say 36 or 38 ?
[481 byte] By [Sahir] at [2007-11-19 15:07:22]
# 1 Re: Scrolling code.
I'm really currious to know how would 36 or 38 (BTW, how did you end up with these numbers?) make it better. There are many cases when people post more or much more than that, so 36/38/40 would still not be enought. Personally I believe the current settings are ok.
cilu at 2007-11-10 3:36:19 >
# 2 Re: Scrolling code.
I'm really currious to know how would 36 or 38 (BTW, how did you end up with these numbers?) make it better.
From experience I have found that most concepts and techniques can be demonstrated with around 30 to 40 lines of code. 30 is the lower boundary. I think most examples will fit in comfortably within 38 lines of code.

There are many cases when people post more or much more than that, so 36/38/40 would still not be enought.

That's usually because code that is not relevant has been included.
Sahir at 2007-11-10 3:37:22 >
# 3 Re: Scrolling code.
Like many other settings, there is not "perfect" number or value that works for everyone. The 30 line setting seems to be best because it fits roughly on a single page within 1024x768 along with a small amount of text. At this time I'd prefer not to change the setting unless there is a large number of people that feel it should be changed.

Brad!
Brad Jones at 2007-11-10 3:38:21 >
# 4 Re: Scrolling code.
From experience I have found that most concepts and techniques can be demonstrated with around 30 to 40 lines of code. 30 is the lower boundary. I think most examples will fit in comfortably within 38 lines of code.

Interesting theory...nearly all of my code samples I post here are far beyond this limit... :o
Andreas Masur at 2007-11-10 3:39:29 >
# 5 Re: Scrolling code.
Interesting theory...nearly all of my code samples I post here are far beyond this limit... :o

Theory is for non-spammers only ;) :p :p
kirants at 2007-11-10 3:40:31 >
# 6 Re: Scrolling code.
Theory is for non-spammers only ;) :p :p
Aha, an exeption case. Typical for programmers. :D
cilu at 2007-11-10 3:41:30 >
# 7 Re: Scrolling code.
Is it possible to make the width dynamic, matching the width of the window? (with probably a mininum width (say 80 chars))
Mathew Joy at 2007-11-10 3:42:34 >
# 8 Re: Scrolling code.
Is it possible to make the width dynamic, matching the width of the window? (with probably a mininum width (say 80 chars))

No. The settings for the software don't support that from what I can find.

Sorry,

Brad!
Brad Jones at 2007-11-10 3:43:28 >
# 9 Re: Scrolling code.
No. The settings for the software don't support that from what I can find.

Sorry,

Brad!
Hmmm...Ok. I see the quote box dynamically changing the width. So I thought the code window can maybe done like that.
Mathew Joy at 2007-11-10 3:44:28 >
# 10 Re: Scrolling code.
Hmmm...Ok. I see the quote box dynamically changing the width. So I thought the code window can maybe done like that.

In a code window you have to deal with PRE tag (non-wrapping) text. That is what makes code windows different to do than the quotes.

Brad!
Brad Jones at 2007-11-10 3:45:29 >