specific src formatting question

A

asaguden

Hi,

I have a specific question regarding source formatting. I like the code
neat and easy to read. For this reason I would like the = sign to be
aligned.

------------------------------
private metod( String arg1, LongClassName arg2 ){
int var = 0;
String myArg1 = arg1;
LongClassName myArg2 = arg2;
}
 
H

Hendrik Maryns

asaguden schreef:
Hi,

I have a specific question regarding source formatting. I like the code
neat and easy to read. For this reason I would like the = sign to be
aligned.

------------------------------
private metod( String arg1, LongClassName arg2 ){
int var = 0;
String myArg1 = arg1;
LongClassName myArg2 = arg2;
}

Eclipse has an option ‘align declarations in columns’ in its formatter
preferences. It does almost what you want.

H.
--
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
 
D

Daniel Pitts

asaguden said:
Hi,

I have a specific question regarding source formatting. I like the code
neat and easy to read. For this reason I would like the = sign to be
aligned.

------------------------------
private metod( String arg1, LongClassName arg2 ){
int var = 0;
String myArg1 = arg1;
LongClassName myArg2 = arg2;
}

Personally, I don't usually find that easier to read.
If it were, say, a grouping of the same type of variables, I could see
aligning it that way. but really...

String myString = "hello World";
int myInt = 1;

is easier to read than:

String myString = "Hello World";
int myInt = 1;

All I see is ("Hello World" 1), and I have to spend a little more
effort to match values with variables.

Granted, it is slightly more aesthetically pleasing, but not enough to
justify that use in my opinion.

I agree, neat and easy-to-read code are VERY important, but I don't
think neat is the same as easy-to-read in this case. I think
easy-to-read loses out.

Well, just my opinion anyway.

:)
 
A

Alfred

asaguden said:
Hi,

I have a specific question regarding source formatting. I like the code
neat and easy to read. For this reason I would like the = sign to be
aligned.

------------------------------
private metod( String arg1, LongClassName arg2 ){
int var = 0;
String myArg1 = arg1;
LongClassName myArg2 = arg2;
}

Yes.

Alfred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top