CA1709 - 我们应该忽略这一点并使用 Db 或 DB 吗?
我知道这听起来很愚蠢,但是对于 CA1709,我们是否应该忽略这个错误,只是做微软所做的(使用 Db 作为数据库的缩写)?
只是想知道外面的人在做什么。对我来说,当微软到处使用 Db
时,使用 DB
似乎很愚蠢。
I know it sounds silly, but in regards to CA1709, should we ignore this error and just do what Microsoft did (which is use Db as the acronym for Database)?
Just wondering what people out there are doing. To me, it seems silly to use DB
when Microsoft uses Db
all over the place.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
引用 Brad Abrams 在优秀的框架设计指南中的说法:
换句话说,按他们说的做,而不是照他们做的做。 :)
另外,“Db”是缩写,而不是首字母缩略词。数据库就是一个词。根据指南,标识符中绝不能使用缩写。 (“Id”是一种特殊情况。)
遗憾的是,CA1709 链接列出了以“DB”为例。 :(
Quoting Brad Abrams in the excellent Framework Design Guidelines:
In other words, do as they say, not as they do. :)
Also, 'Db' is an abbreviation, not an acronym. Database is one word. Abbreviations should never be used in identifiers per the Guidelines. ('Id' is a special case.)
Sadly the CA1709 link lists 'DB' as an example. :(
这并不重要,不是吗?选择您最喜欢的 - 但随后确保始终如一地使用它。对于编码和命名约定,主要是选择您喜欢的并保持一致
It doesn't really matter, does it? Choose what you like best - but then make sure you use it consistently. With coding and naming conventions it's mainly about choosing one you like and be consistent