Message from discussion How long can a statement be?
From: Dick Hendrickson <dick.hendrick...@att.net>
Subject: Re: How long can a statement be?
References: <Pine.SOL.3.96.1000306155954.2656Aemail@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
Content-Type: text/plain; charset=us-ascii
X-Trace: bgtnsc05-news.ops.worldnet.att.net 952548083 220.127.116.11 (Wed, 08 Mar 2000 20:41:23 GMT)
Organization: AT&T Worldnet
NNTP-Posting-Date: Wed, 08 Mar 2000 20:41:23 GMT
Robert Orban wrote:
> Dare I ask, in this day of editors with automatic word-wrap, automatic
> indentation, and automatic formatting, why there is _any_ limit to the
> length of a line?
Partly, it's tradition.
Other reasons include:
It's hard to know how to format error messages when lines are really
If there is no limit in the standard, each vendor will (probably) impose
a limit and codes won't really be portable. Hard disk size (if nothing
else) will stop most any line eventually.
Different screens/OSs/compilers will wrap lines at different points and
make portable reading of long code lines hard for humans.
The big one in my mind is internal representation and optimization.
Optimizing compilers look at each token a ton of times and it's nice
to have the internal representation be compact (ie "fit in a word").
It's also nice to have things like open parens point to their matching
close paren, have the beginning of one statement point to the start of
either (or both) the previous or next statement, etc.
If the line length is unlimited, then there is no practical way to
set up reasonably small fields for these pointers. Again, different
vendors are likely to impose different limits, based on token counts
rather than lines and characters, and portability will suffer.
None of these are obvious killers, but they add up to a "reason" to
specify a size in the standard; especially since very few codes
"really really" need real long lines.