用于 MVC 应用程序的 StyleCop

发布于 2024-07-24 10:07:19 字数 161 浏览 6 评论 0原文

我们计划将 StyleCop 用于我们的 MVC 应用程序。 有人使用 StyleCop 进行 MVC 吗? 如果我能了解使用风格警察的优点和缺点,那就太好了。

We are planning to use StyleCop for our MVC application.
Has anyone used StyleCop for MVC?
It would be great if I could get the pros and cons for using style cop.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一口甜 2024-07-31 10:07:20

我已经在我编写的应用程序软件中使用 StyleCop 一段时间了,它是强制执行标准编码风格的绝佳工具。 最重要的是要采取一种态度,即一种风格通常与另一种风格一样好——客观上没有一种风格更优越。 有了这种简单的理解,StyleCop 最终将成为一个强大的工具,使代码阅读、导航和维护变得更加简单。

我还没有真正遇到过 stylecop 的任何真正的缺点。 我怀疑有些人可能会声称,除了特定规则是否被强制执行之外,其样式不可配置,但我认为事实并非如此。 该工具的存在是为了全面强制执行统一的样式,如果您可以将其配置为需要或不需要 this. 前缀,那么就会达不到目的。

I've been using StyleCop for a while with the application software that I've been writing, and it's been a great tool for enforcing a standard coding style. The most important thing to take into it is an attitude that one style, generally, is as good as another-- there isn't one that's objectively superior. With that simple understanding, StyleCop will end up being a powerful tool that makes code reading, navigation, and maintenance simpler across the board.

I haven't really encountered any genuine cons for stylecop. I suspect that some people might claim the fact that its styles aren't configurable beyond whether a particular rule is or isn't enforced to be a con, but I don't think that it is. The tool exists to enforce a uniform style across the board, and if you could configure it to require this. prefixes or not, then that would defeat the purpose.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文