Automatic CodeAlignment by IDEA was a hot subject in the newsgroup recently.
Why bother :
- readability => comfort => productivity
- each line you write, will be read by you - or others - many times.
- in a team, even a not great CodingStandard is better than no CodingStandard at all. It helps you feel at home with the code.
Here is a quick poll, to know the feeling and usage of this community.
How to vote : Add you name in the appropriate table cell, after the code sample, and a comment, if you wish. You may choose more than 1 version.
(You may need to visit TWikiRegistration first)
AlainRavet
FYI - I wrote a plugin that can format like Version 7: TabifierPlugin
-- JordanZimmerman - 19 Jul 2002
(Readable == helps you answer the following questions :
- Is the boolean variable onFlag defined here?
- Is there an unassigned variable?
- How many strings?
- what's the problem with digits?
- Are there any numbers defined here?
)
| version 1 : no group, no aligment |
String court ="s", veryLong ="abcdefghijklmnopqrstuvwxyz";
boolean isOn = true, notAssigned ,isConnectedOrWillBeSoon = true ;
char digit[] = {'0','1','2','4','5','6','7','8','9'};
| version 2 : 1 line/variable |
String court ="s";
String veryLong ="abcdefghijklmnopqrstuvwxyz";
boolean isOn = true;
boolean notAssigned;
boolean isConnected = true ;
char digit[] = {'0','1','2','4','5','6','7','8','9'};
| version 3 : group by type |
String court ="s",
veryLong ="abcdefghijklmnopqrstuvwxyz";
boolean isOn = true,
notAssigned,
isConnected = true ;
char digit[] = {'0','1','2','4','5','6','7','8','9'};
| version 4 : group v1 and alignment |
String court = "s" ,
veryLong = "abcdefghijklmnopqrstuvwxyz" ;
boolean isOn = true ,
notAssigned ,
isConnected = true ;
char digit[] = {'0','1','2','4','5','6','7','8','9'} ;
| version 5 : 1 line/variable, group v2 and alignment |
String court = "s" ;
String veryLong = "abcdefghijklmnopqrstuvwxyz" ;
boolean isOn = true ;
boolean notAssigned ;
boolean isConnected = true ;
char digit[] = {'0','1','2','4','5','6','7','8','9'} ;
| version 6 : 1 line/variable, group v3 and alignment |
String court = "s" ,
veryLong = "abcdefghijklmnopqrstuvwxyz" ;
boolean isOn = true ,
notAssigned ,
isConnected = true ;
char digit[] = {'0','1','2','4','5','6','7','8','9'} ;
| version 7 : 1 line/variable (#2) |
String court ="s";
String veryLong ="abcdefghijklmnopqrstuvwxyz";
boolean isOn = true;
boolean notAssigned;
boolean isConnected = true;
char digit[] = {'0','1','2','4','5','6','7','8','9'};
| version 8 : 1 line/variable, (#2) and alignment |
String court = "s";
String veryLong = "abcdefghijklmnopqrstuvwxyz";
boolean isOn = true;
boolean notAssigned;
boolean isConnected = true;
char[] digit = {'0','1','2','4','5','6','7','8','9'};
| version 9 : group and alignment |
String
court = "s",
veryLong = "abcdefghijklmnopqrstuvwxyz";
boolean
isOn = true,
notAssigned,
isConnected = true;
char[]
digit = {'0','1','2','4','5','6','7','8','9'};
Q/ What is the difference between version 5 and version 8?
A/ v5 inserts a space line between type groups.
f1c
CategoryPolls
A page like this deserves a visit from The Anal-Retentive Chef:
|
|