了StyleCop SA1124 DoNotUseRegions是否合理? [英] StyleCop SA1124 DoNotUseRegions is reasonable?

查看:358
本文介绍了了StyleCop SA1124 DoNotUseRegions是否合理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SA1124 DoNotUseRegions建议区域不应当在任何地方使用。是不是真的合理吗?

SA1124 DoNotUseRegions suggest that region should not be used anywhere. Is it really reasonable?

我觉得区域是一种分组相对代码放在一起,让大班容易阅读,例如,如果生成通过上下文菜单在VS2008的类接口的方法,一个区域将被自动插入。

I think region is a way to group relative code together and make large class easy to read, for example, if you generate interface method for a class in vs2008 via context menu, a region will be automatically inserted.

我想同时检查代码风格删除此规则。请问您对这个规则的意见呢?

I would like to remove this rule while checking code style. May I know your opinions on this rule?

推荐答案

这将是一个个人喜好的事情。这里唯一重要的是您和您的团队喜欢什么。忘记警察说什么风格,你的那些读它,你是一个人维护它,无论带或不带区域为你工作好,这是最重要的。

This is going to be a personal preference thing. The only thing that matters here is what you and your team prefer. Forget what style cop says, you're the ones reading it, you're the one's maintaining it, whether with or without regions works better for you, that's all that matters.

如果你正在释放它作为一个开源项目... ,这是我的意见在这里的,我认为同样适用。无论使用的核心团队更舒服。如果你得到更多的团队成员乘坐多贡献,重新登陆这个问题之后,这总是可以改变。

If you're releasing it as an open-source project...and this is my opinion here, I think the same applies. Use whatever the core team is more comfortable with. If you get a lot more team members aboard and more contribute, re-visit the issue later, this can always be changed.

这篇关于了StyleCop SA1124 DoNotUseRegions是否合理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆