Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

specific src formatting question

Thread view: 
asaguden - 19 Dec 2006 08:12 GMT
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?
Hendrik Maryns - 19 Dec 2006 09:45 GMT
asaguden schreef:
> Hi,
>
[quoted text clipped - 11 lines]
>
> 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.
Signature

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

Daniel Pitts - 20 Dec 2006 00:42 GMT
> Hi,
>
[quoted text clipped - 11 lines]
>
> 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.

:-)
Alfred - 22 Dec 2006 16:49 GMT
> Hi,
>
[quoted text clipped - 11 lines]
>
> Can any source formatter handle this?

Yes.

Alfred


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.