Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338086 - Coding conventions: Increase line length limit
Summary: Coding conventions: Increase line length limit
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 1.4 M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-24 09:01 EST by Ralf Sternberg CLA
Modified: 2011-03-07 06:59 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2011-02-24 09:01:16 EST
Our current coding conventions [1] limit the length of a line to 80 characters. This leads to a lot of line breaks within statements, especially where classes and variables have long names. As single-line statements are much easier to read, this restriction often urges developers to abbreviate names to make a statement fit into a line. So this restriction contradicts with the rule to choose explanatory names.

Rüdiger and I agreed that we should increase the line limit to 100 chars.

Opinions?

[1] http://wiki.eclipse.org/RAP/CodingConventions
Comment 1 Holger Staudacher CLA 2011-02-24 09:32:03 EST
+1
Comment 2 Beyhan Veliev CLA 2011-02-24 09:54:24 EST
+1. My preferred line length limit is 120.
Comment 3 Ralf Sternberg CLA 2011-02-24 17:40:33 EST
(In reply to comment #2)
> +1. My preferred line length limit is 120.

Even with a screen resolution of 1680px in width, I can't read 120 characters in the Eclipse editor area when package explorer and outline view are visible. And there are still some smaller screens around. Therefore I don't like to exceed 100 characters now. With this limit I guess, most of the reasonable statements will fit into one line.
Comment 4 Frank Appel CLA 2011-02-25 04:12:31 EST
+1
Comment 5 Austin Riddle CLA 2011-03-01 11:26:49 EST
It is my opinion that line length should be based on the screen real estate that a team works with.  People don't print code anymore so they don't care that it fits nicely on a piece of paper and 80 character line length is based on the old Fortran days where column index was important and the max column was 80. However, I do think that setting the length too long will force people with lower resolutions to have to scroll horizontally, which is a mistake from a user interface perspective.  I think that breaking up statements into multiple lines is in general preferable to long statements. There is some happy medium. 100 seems reasonable and equates to about 840 pixels on my monitor.
Comment 6 Ralf Sternberg CLA 2011-03-07 06:59:11 EST
There were no objections and my impression is that we're all happy with 100 characters per line - so I guess we have agreed on this. Let's use 100 characters per line from now on.
I have changed the formatter settings in CVS HEAD and adapted the wiki page.