stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: svn commit: r569152 - /incubator/stdcxx/branches/4.2.0/etc/config/src/LIMITS.cpp
Date Wed, 05 Sep 2007 01:40:40 GMT
Mark Brown wrote:
>> -----Original Message-----
>> From: sebor@roguewave.com
>> Sent: Sun, 26 Aug 2007 17:37:02 -0600
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: svn commit: r569152 -
>> /incubator/stdcxx/branches/4.2.0/etc/config/src/LIMITS.cpp
>>
>> Mark Brown wrote:
>>>> -----Original Message-----
>>>> From: sebor@roguewave.com
>>>> Sent: Fri, 24 Aug 2007 09:29:36 -0600
>>>> To: stdcxx-dev@incubator.apache.org
>>>> Subject: Re: svn commit: r569152 -
>>>> /incubator/stdcxx/branches/4.2.0/etc/config/src/LIMITS.cpp
>>>>
>>>> Andrew, please be sure to observe the 78 characters/line limit
>>>> in Change Log entries as documented in bullet (3) of the Patch
>>>> Format section on the Bugs page:
>>>>    http://incubator.apache.org/stdcxx/bugs.html#patch_format
>>>>
>>>> The reason for this limit in both ChangeLogs and source files
>>>> is that they all need to be readable on traditional VT100 text
>>>> terminals.
>>> I have seen coding styles with a 79 character limit (for instance
>>> Python) but I am curious what the rationale for the 78 character limit
>>> is when even the VT100 displays have 80 columns?
>> Opening a file with 80 characters per line in emacs with a buffer
>> width set to 80 columns will wrap the last character of the next
>> line. So if all you have to work with is an 80x24 text terminal
>> and want to run emacs in it you want files to have no more than
>> 79 characters per line. You can recreate this experience in an
>> xterm or similar terminal by setting it to 80 characters and
>> starting emacs with the -nw option.
> 
> If I understand correctly what you're describing, emacs -nw will display lines with up
to 79 characters in a 80 column frame without wrapping. What, then, is the rationale for at
most 78 characters?

You're right, that was a thinko on my part. Sounds like 79 should
work, but...

I've done some searching online to see what coding standards there
are out there and what rationale they give for imposing which limit.
What I've found is there are standards that impose a limit of 80
characters, others that call for no more than 79 characters, and
others still that require at most 78 characters. However, not all
of them are explicit about what these characters are, specifically
whether the newline separator is or isn't part of the limit. The
killer argument (IMO) in favor of the 78 character limit (not
including the newline, or 79 character limit including it), is
the fact the Unified diff format prepends a character to every
line to indicate whether it is being added ('+') or removed ('-')
or neither. So with at most 78 character lines, diffs still
display correctly on an 80 column display, but at 79 characters
they warp around to the next line.

Here's a reference:
http://amis.sourceforge.net/devel/CppCodingStandard.html#linelen

Martin

Mime
View raw message