[phobos] Column limits again

Andrei Alexandrescu andrei at erdani.com
Sun Apr 10 11:01:36 PDT 2011


I wanted to make it clear that this is not the time to bring again the 
arguments, as there have been ample discussions on the topic in the 
past. In particular your arguments that you now repeated have been 
definitely read and understood, as well as refuted.

This is the time to conclude all that discussion with a simple decision. 
Again, clearly some limit must exist because current code editors don't 
handle long lines satisfactorily and some contributors want to keep 
editing windows less than most or full screen width.

I think a soft limit (very strongly recommended) of 80 columns and a 
hard limit (absolute, forget about merging your code if you don't 
observe) of 120 columns would be agreeable to all current and potential 
contributors.


Thanks,

Andrei

On 04/10/2011 12:04 PM, Jonathan M Davis wrote:
>> 80 characters.  Not a phobos contributor, but I've been coding for 20 years
>> in various languages.  Long lines are hard to read - almost invariable
>> nasty compound expressions (which should be factored for readability) or
>> extremely long identifier names (nothing wrong with this, but ids should
>> be as long as necessary and no longer.  There is no benefit to putting so
>> much stuff onto a single line.
>>
>> If you don't like coding style rules, tough - welcome to the real world.
>>   Until we write an IDE that operates on ASTs and formats code on an
>> individual basis, we will continue to have to do these things.
>>
>> P.S. As a general rule, maintain the formatting style of the file in which
>> you are making edits (spacing, bracing, etc.)
>
> I confess that I've never understood why anyone would think that 80 characters
> was enough. And almost everyone that I've ever discussed it with prior to it
> coming up on the newsgroups here has thought that an 80 character limit was
> outdated and constraining, so to find folks here thinking that 80 characters
> is a good limit is very odd. It's just too short.
>
> The main problem is indenting. If no code were indented, then 80 characters
> wouldn't be so bad. But when you indent much at all (especially with 4
> characters per level of indentation), 80 characters very quickly becomes too
> short. And if you have appropriately descriptive symbol names, then you're
> doubly screwed.
>
> So, while a character limit may make sense, I don't understand how anyone
> could be happy with only 80 characters. Sure, there are plenty of lines of
> code that will fit within 80 characters, but it doesn't take much at all
> before they don't - particularly with 4 characters per level of indentation
> and properly descriptive variable names. 80 is just too restrictive. 80
> characters after the indentation wouldn't generally be a problem, but when it
> includes the indentation, it's definitely a problem.
>
> - Jonathan M Davis
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


More information about the phobos mailing list