在.NET中每个文件规则一类? [英] One class per file rule in .NET?

查看:145
本文介绍了在.NET中每个文件规则一类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循这个规则,但我的一些同事不同意,并说,如果一类是小的,可以留在同一个文件与其它类(ES)。

I follow this rule but some of my colleagues disagree with it and argue that if a class is smaller it can be left in the same file with other class(es).

我听到所有的时间另一种说法是即使微软并没有这样做,所以我们为什么要?

Another argument I hear all the time is "Even Microsoft doesn't do this, so why should we?"

什么是对这个普遍的共识?在这其中,应该避免出现的情况下?

What's the general consensus on this? Are there cases where this should be avoided?

推荐答案

每个文件的一类也给你一个更好地了解每个检查正在发生变化,不看文件的diff文件。

One class per file also gives you a better idea of what each check in is changing without looking at the diffs of the file.

这篇关于在.NET中每个文件规则一类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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