gpt4 book ai didi

c# - CA1709 - 我们应该忽略它并使用 Db 还是 DB?

转载 作者:太空狗 更新时间:2023-10-29 22:17:05 25 4
gpt4 key购买 nike

我知道这听起来很傻,但关于 CA1709 ,我们是否应该忽略这个错误并像微软所做的那样(使用 Db 作为数据库的首字母缩写)?

只是想知道外面的人在做什么。对我来说,当微软到处使用 Db 时,使用 DB 似乎很愚蠢。

最佳答案

在出色的 Framework Design Guidelines 中引用 Brad Abrams 的话:

...I have heard every possible excuse for violating these naming guidelines. [...] For the most part, our customers have seen the places in which we have diverged from these guidelines (for even the best excuse) as warts in the Framework.

换句话说,照他们说的做,而不是照他们做的做。 :)

此外,'Db' 是缩写词,而不是首字母缩略词。数据库是一个词。根据指南,绝不能在标识符中使用缩写词。 ('Id' 是一个特例。)

遗憾的是,CA1709 link 将“DB”列为示例。 :(

关于c# - CA1709 - 我们应该忽略它并使用 Db 还是 DB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6700355/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com