JoshuaJeong / nhin-d

Automatically exported from code.google.com/p/nhin-d
0 stars 0 forks source link

All checked in .java code should have the same code/style format. #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

All checked in .java code should have same code/style format.

This substantially reduces the cost of branching and merging.

This also improves the readability of code by enforcing uniformity.

Finally this allows to grow committers while stillist maintaining a common 
coding style.

This can easily be accomplished by including an eclipse code format file and by 
applying the format to all currently checked in files.

Original issue reported on code.google.com by jwein...@gmail.com on 8 Mar 2011 at 2:15

GoogleCodeExporter commented 9 years ago
I agree that consistency in style would be really good to have, but I don't 
feel good about doing it at the cost of IDE neutrality. 

Original comment by bgran...@harris.com on 9 Mar 2011 at 2:48

GoogleCodeExporter commented 9 years ago
This link describes a number of code formatter options
http://stackoverflow.com/questions/996646/stand-alone-java-code-formatter-beauti
fier-pretty-printer

Code formatting can be achieved with IDE neutrality by
1) Using a code formatter api
2) and minimally running the formatter prior to major and minor releases
3) If this route is chosen then in my mind the code formatter should be applied 
ASAP and then as 2 states.
4) Ideally the formatter would be run prior to checkin and having a script or 
maven integration would allow for developers who follow the process to do so

This ensures that the source base is leaning towards a uniform format and is 
IDE agnostic. In my mind the benefits greatly outway the little extra work. 
Noting that if the plugin is a maven plugin you can have a target which is run 
prior to said releases or developer can run prior to checkin. Ultimately code 
format (on release) would be responsibility of releasing engineer.

Diffs and merges are unnecessarily complicated by code bases which do not 
employ uniform code format.

The effort here is minimal.

Original comment by jwein...@gmail.com on 9 Mar 2011 at 5:23

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here is a referenced link which describes an api for formatting via the command 
line

http://www.peterfriese.de/formatting-your-code-using-the-eclipse-code-formatter/

As a clarification IDE agnostic can mean that a specific IDE is not required 
for development. This does not necessitate that formatting does not require a 
specific tool. In this case eclipse can be used to standardize formatting. 
Other options exist. See link in prior comment.

Original comment by jwein...@gmail.com on 9 Mar 2011 at 5:33

GoogleCodeExporter commented 9 years ago

Original comment by bgran...@harris.com on 10 Mar 2011 at 8:03

GoogleCodeExporter commented 9 years ago

Original comment by bgran...@harris.com on 20 Apr 2011 at 7:36

GoogleCodeExporter commented 9 years ago

Original comment by gm2...@cerner.com on 8 Sep 2011 at 7:39