(was: Re: [magnolia-dev] [magn olia-svn] [12148] MAGNOLIA-1698
Magnolia now works with forward and error dispatchers)
On Nov 1, 2007, at 17:03 , Fabrizio Giustina wrote:
Yes, I always try to avoid reformatting as you can see in other
commits, but when I change different parts of a class I often end up
with an automatic CTRL SHIT F...
Sure, I wasn't blaming you for doing it all the time; and it surely
happens to me too every now and then (except I do apple-alt-L). I
always try to review all my changes before committing, to make the
jira IDs and commit messages are appropriate. I believe this is
important, and gives me confidence when others do it too. (i.e I can
rely on the message and jira id to see what has changed with regard
to a certain topic, and/or we can quickly locate changes that need to
be reviewed or might conflict with whatever we're working on)
The formatting of the code in svn now looks pretty different from the
standard we tried to follow time ago (maybe you should adjust the idea
configuration in order to be more similar to the eclipse one... I did
the idea config file time ago but you know I'm an eclipse user ;) )
This is really annoying for me, I always try to work in a way that
everything must always be automatically formatted before a commit,
that's the only way to keep consistency but the current code gets
totally reformatted also if I use the configuration that should be the
standard for the project.
I know. One of the issues I personally have there is that I find some
points of that style pretty unreadable or "noisy". And I don't want
to start a flame war about this subject, because I know I'd fight
with arguments like "are you still working on a 60 columns terminal
from 1982?" ;))
Another issue I have with certain automatic code style rules is that
they're sometimes too drastic. For example, in certain occurrences it
makes very little sense to split a long String on several lines
(debug log messages), and in others it totally does (in a testcase,
where we create a mock hierarchy manager with properties represented
as a String for convenience). In most cases, common sense seems to
give better results than hard rules.
Third issue is that I've seen some code or test break after automatic
restyling. I can't remember on the top of my head what the reason
was, but it sure was pretty darn hard to track down. (but that's
linked to #2, because it was due to a very strict rule)
Fourth issue is that I've never seen people having difference taste
in code style actually reaching a consensus. (some people don't care,
but those who care seem impossible to get to agree)
About the "format before commit" option, another possibility is to
get a nightly cron to check the code format on the whole codebase and
do one daily commit if needed.
I am pretty tempted to select the whole workspace and do a formatting
for everything... do you mind if I do that? :)
Ha ha ... guess what? Yeah I do :-p
Whenever I'll have some time (post 3.1), maybe I'll check what we
currently have as code style guidelines, tools/plugins and config
files, write some proposal for changes if I feel like it, make sure
all config files (idea, eclipse and whatever automated tool is used)
are in synch (ideally generate them from one another), and maybe
automate the process somehow.
In any case, reviewing your (the general your, not you Fabrizio;))
changes before committing is good practice and will help maintenance
of the codebase easier !
Thanks for reading my rants + Cheers
greg
----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------