[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Code Width and Comment Style (Was: What counts as a fork?)
- From: Hakki Dogusan <hakki@...>
- Date: Fri, 1 Dec 2017 09:51:35 +0300
30-11-2017 21:10 tarihinde Rena yazdı:
On Nov 30, 2017 2:49 AM, "Paige DePol" <email@example.com> wrote:
Alexis <firstname.lastname@example.org> wrote:
Paige DePol <email@example.com> 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.
I think these magic numbers come from printer column sizes;
normal mode:80 ch, condensed mode:132 ch.
(for continuous form dot-matrix printers)
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!
I'm cutting text at 78'th column.
I almost never exceed 80 columns. It's a sensible limit and lets me fit
three editor panes on my screen at a nice font size.