> What about variables local to a block e.g. deep in three-deep nested
ifs?
> Will it put them back at the original indent level too, or just to the
> level of the nested if's opening brace?  If the latter, then I don't
think
> it makes it any easier to find than just having declarations at the
top of
> a block with a blank line before the code.

Yes everywhere, even in nested blocks. This way when you want to see a
local variable declaration your eyes automatically go after an
unindented line in current block or maybe parent block. Actually it's a
coding convention I've been using since 1994-95 when I was coding VC++.
So I feel comfortable with it but it's not a religious preference for
me! So if team members think it's bad then I'll change it.

> Still, what do I know - I actually prefer opening braces on the same
line
> (except for the class/method definitions), since that lets you see
more of
> the code on a single page...

Well, but I think the whole benefit of {} is that they should be aligned
beneath each other! :-) And I've seen lots of unreadable codes that were
in unreadable state because of high density of lines of code, no empty
lines, no separation, so you see a ton of characters appearing right
after each other! Anyway it's really a personal taste :o)

> What you need is an IDE that displays it with whatever format you
prefer
> but saves it in a different preset format, say by having the load/save
> actions call a suitable <pretty> ant script.  Now there's an idea for
a
> new NetBeans module :-)

It's possible. With IDEA it's easy, create an external tool which
triggers a batch file with "java PrettyPrinter blabla" in it (make it
minimized on Windows). Set parameters to $FilePath$, and working
directory to $FileDir$ and you can also assign it a key from keymap,
maybe ctrl+s so that when you save it's auto-beautified too (IDEA will
save the file when you run an external tool).
But we use <pretty/> in all our projects, this way code convention is
mandated, and that's the whole idea of <pretty/>.

Ara.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to