Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > specific src formatting question

Reply
Thread Tools

specific src formatting question

 
 
asaguden
Guest
Posts: n/a
 
      12-19-2006
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;
}
------------------------------

Can any source formatter handle this?

 
Reply With Quote
 
 
 
 
Hendrik Maryns
Guest
Posts: n/a
 
      12-19-2006
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;
> }
> ------------------------------
>
> Can any source formatter handle this?


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
 
Reply With Quote
 
 
 
 
Daniel Pitts
Guest
Posts: n/a
 
      12-20-2006
asaguden wrote:
> 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;
> }
> ------------------------------
>
> Can any source formatter handle this?


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.



 
Reply With Quote
 
Alfred
Guest
Posts: n/a
 
      12-22-2006
asaguden wrote:
> 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;
> }
> ------------------------------
>
> Can any source formatter handle this?


Yes.

Alfred
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What does the SRC in <IMG SRC> stand for? pheadxdll HTML 16 06-06-2007 02:45 AM
Convert Java Src to J2ME Src? macbrando@gmail.com Java 1 03-23-2007 01:29 PM
<txt src= ...> equivalent of <img src= ...> Steve Richter ASP .Net 3 02-09-2006 08:44 PM
src.jar (src.zip) missing on Mac OSX Java 1.4.1 installation? Greg Johnson Java 4 09-18-2003 07:21 AM
Problem: Setting MSIE iframe innerHTML change relative href/src to absolute href/src Soren Vejrum Javascript 4 07-05-2003 01:47 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57