[MonoDevelop] Code cleanup options
ibboard at gmail.com
Wed Sep 15 16:07:11 EDT 2010
On 15/09/10 20:48, Mike Krüger wrote:
>> Mike has just closed Bug 595578  (Allow "Format Document" on save) -
>> I knew he'd come round to my suggestion in the end ;) - so I thought I'd
>> start a discussion about some of the details.
>> I use Eclipse during the day, and while it has too many options in some
>> parts, I think the auto-formatting is really useful and well done. We
>> use it at work to ensure consistency between developers and with coding
>> standards, as well as being a lazy way to fix up white space and indent
>> issues etc. without you having to think about it.
> Interresting - I thought the old formatting wasn't usable at all but the
> last few days I met some people using it. I guess when using it always
> you naturally worked around it's shortcommings.
Yeah, I just worked with the auto-formatter as it was. It had a couple
of oddities, but most of the time it was usable and more of a help than
a hindrance :) I look forward to using the new one and giving a bit of
feedback once I stop editing my wife's new website and get back to some
>> Personally, I think formatting should (if possible) be a project setting
>> as it would make it easier for developers to be consistent on a project.
>> As an example, all of my code uses the "Method(args)" and brackets on
>> their own lines style, while MD uses "Method (args)" and brackets on the
>> same line as the block statements (but not methods etc). If the settings
>> were per-project with a fall-back to the IDE (like the existing default
>> policies) then I'd be able to work on MD and my code without worrying
>> about whether I was formatting each one correctly.
> This IS a project setting - and always was. (with a default in standard
Sorry, slight miscommunication there. I meant the auto-formatting. You
could argue that it was a developer's preference as to whether to do it
automatically or not, but from a project management point of view then
being able to force the auto-formatting could be good (which is what our
Eclipse settings do, I think - although I'll now have to double-check
that it isn't just the common preferences file we use!)
>> In terms of available options, I think MD is fairly close to the core of
>> the options that Eclipse has, but a bit more boolean. Some of the
>> Eclipse options can take numbers (like the amount of new lines to
>> maintain, which is useful for pruning down gaps). Some of the other
>> options are also a bit more flexible (I think it is a "always, never,
>> when necessary" option) but that might be less important.
>> Any thoughts or opinions?
> I'll check the eclipse stuff - the current options are only the 1st
> version. I've not worked much at the options - since the old formatter
> didn't work.
I'm sure there are other ways to do it, but I do quite like the Eclipse
layout for the editing, as well as some of the options it has. The
current MD interface is usable, but the "folders" grouping is a bit odd
- it stops long lists, but it also results in slightly terse names and
nesting in unusual places for "item and folder" lists.
More information about the Monodevelop-list