lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

For most languages, I use 80 columns, and never more than 120.

My main reason for this is that my sight is not very good, so I use
large fonts. On a large monitor (I typically use a 27")  I can fit a
text editor and a terminal side by side, on a 13" laptop I can fit
one of those.

Moreover, I find it hard to follow the flow of a program when
lines are too long, similar to prose (too much eye movement).
I have had to work with some Objective-C code bases and I
had a very hard time because of that (I ended up rewriting
some parts in pseudo-code in comments for that reason).

Pierre Chapuis

On Thu, Nov 30, 2017, at 08:48, Paige DePol wrote:
> Alexis <> wrote:
> > 
> > Paige DePol <> writes:
> > 
> >> From a code refactoring point of view, is there still a need to limit
> >> code to 80 columns?
> > 
> > Not sure about the code-refactoring POV, but even if technology allows
> > for more columns, limiting code to less than 80 columns might benefit
> > comprehensibility and speed of reading:
> > 
> > "In order for on-screen text to have both the best speed and
> > comprehension possible about 55 cpl should be used."
> > 
> > --
> Yes, for typography, as in books and the like, that does make sense,
> however, source code isn't quite the same as written text in terms
> of reading and parsing. Though, Lua is probably closer than C! ;)
> In Objective-C, for example, the selectors can be quite verbose and
> statements can exceed 80 columns fairly quickly, especially when
> doing logic statements. Though, that said, I have seen where people
> break down the selector by sections onto multiple lines as well.
> One thing I was contemplating, and have seen in other projects, was
> to align the comments on the 81st column, with a total page width
> of 132 columns. So 80 columns for code, and 52 columns for comments.
> What standards for code width and comments styles do you all use?
> Not for Lua, mind you, but for C or C-like languages. Of course,
> this will also depend on whether tabs or spaces are used... I do
> not want to get into a debate about spaces vs tabs, I am just
> curious about code width and comment styles is all! 
> ~Paige