2013/8/8 Mark Thomas <ma...@apache.org>:
> Currently, Tomcat has an 'guide' of a maximum of 80 characters for line
> length. It has been a while since we reviewed this and as we are looking
> at style rules...
>

Changing @SuppressWarnings had its technical reasons. I do not see
much reasons to reconsider code formatting.

> As a starting point what do folks think of the following options:
>
> Line length:
>  80 - the current
> 100 -
> 120 -
>
> Strictness
> Informal - the current
> Enforce  - Use checkstyle to enforce whatever limit is chosen
>

My preference is to keep the current "80", not enforcing.

I can go with 100, it is not much of a change.
I think 120 (+50%) will be too much.

Regardless of our preference for Java files, I think textual files
like RUNNING.txt should adhere to 80 characters limit.

We have a bunch of code copied from Apache Commons. Do they have
longer line lengths?

(From a quick look they use the same 4 spaces indent, but I do not see
info on line lengths,
http://commons.apache.org/patches.html


> Pros for longer lines:
> - code easier to read

It depends on your environment.

> Cons
> - diffs may wrap in mail clients

It is my main concern.

Other concern is that sometimes files are compared side-by-side. One
example: "Colored Diff" mode in viewvc.

> - harder to work with code in a pure text interface (particularly if
> that interface is limited in width to 80 chars)
>
> Comment
> - With increasing screen resolution I expect IDEs to manage widths upto
> 120 or possibly even more

Resolution does not matter. Screen size does.  Smartphones and
netbooks that people use in their free time do not have big screens.

> - Few (any?) folks will ever need to work in a pure text UI where the
> line length is limited

I routinely go without an IDE in a console (editing of documentation,
or quick reviews), but I cannot say that my line length is limited. I
can scroll or reconfigure it.

Regarding "non enforcing":
1. It is too dumb of a rule. Sometimes long lines are better. E.g. in
*.properties files we have very long lines.
2. I do not want another global reformatting of the code.

For my own code I use indent of 2 spaces and line width limit of 100
for Java, 75 for documentation.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to