Closed GoogleCodeExporter closed 9 years ago
started investigation
Original comment by Hans.Gyl...@gmail.com
on 11 Oct 2011 at 11:30
Status:
*******
Declined
Decision and limitation:
************************
The length per line remains 115 characters as stated in
http://code.google.com/p/oppna-program/wiki/Anpassningar_av_VGRs_utvecklingsmilj
o
Motivation:
***********
The guidelines are set up to take in to account several consideration:
- pair programming situations (that is why the font size is defined as 14 pixel)
- enabling developers with a specific computer set up (e.g. 15" lap top) to work
Research:
*********
- After research there seems to be a attitude that SUN´s old 80 characters
suggestion is outdated and moved to more like max 120 characters per line.
- Asking people in the team as well as ICC team about oppinion
- Java Ranch max 120 characters: http://www.javaranch.com/styleLong.jsp#length
- Android: Max 100 characters:
http://source.android.com/source/code-style.html#limit-line-length
- Take into account people with dissabilities or laptops
http://krbtech.wordpress.com/2010/03/06/sun-java-coding-conventions-revisited/
"4.1. Line Length
The line length limit of 80 is an anachronism, a relic of text mode terminals and days gone by when printing source code was common.
These days, though, it is no longer practical. Source code is rarely printed, lines are longer, and a short line maximum means more
line continuations, which means code that is less readable.
There should be a maximum, but it should be higher than 80. It should take into account typical use cases of developers
(e.g. screen size/resolution and window width), but also accommodate less common cases (e.g. developers who use larger font sizes due to vision issues)."
Suggestion to solve problem with long method signatures
*******************************************************
If long methodnames arrise having lots of annotations then line up each
argument on a separate row like:
@RequestMapping(value = "/add", method = RequestMethod.GET)
public ModelAndView addUserMethodWithVeryLongName(
@ModelAttribute("userVariableName") Event event,
@Annotation(paramname) ClassX xname,
@Annotation(paramname) ClassY yname,
@Annotation(paramname) ClassZ zname
) throws ... {
Original comment by Hans.Gyl...@gmail.com
on 14 Oct 2011 at 12:45
Original issue reported on code.google.com by
wmda...@gmail.com
on 11 Oct 2011 at 7:43