是完全合格的命名vs使用指令只是一个意见的问题? [英] Is fully qualified naming vs the using directive simply a matter of opinion?
问题描述
我发现现在,我在一个大多数solo环境中工作,我实际上键入完全限定的方法调用越来越多,而不是使用using指令。以前,我只是保持与团队中最突出的编码实践一致。
I find now that I work in a mostly solo environment that I actually type fully qualified methods calls more and more, instead of make use of the using directive. Previously, I just stayed consistent with the most prominent coding practice on the team.
就我个人而言,我更容易一目了然地阅读详细代码,我特别喜欢自动填充,我发现自己更多地使用Google作为我的文档来源完全限定名称返回更窄的结果集。这些显然是非常任意的原因喜欢完全合格使用using指令。
Personally, I find it easier to read verbose code at a glance, I type fast especially with autocompletion and I find myself using Google more often as my source of documentation, which a fully qualified name returns a much narrower results set. These are obviously very arbitrary reasons to prefer fully qualifying over using the using directive.
在这一天和重构工具的时代,有什么具体的原因为什么使用using指令是完全合格的,反之亦然,还是这纯粹是个人酌情权问题,如评论间隔?
In this day and age of refactoring tools, is there a concrete reason why using the using directive is superior to fully qualified or vice versa, or is this purely a personal discretion issue like comment spacing? Finally, which do you prefer and why?
推荐答案
可能称之为主观。
我在哪里工作/我更喜欢使用using语句。它保持名称/线条足够短,这只是使日常生活更容易。此外,您可以将鼠标悬停在完全限定名称的某处。
Where I work/What I prefer is to use using statements. It keeps the names/lines short enough, which just makes day to day life easier. Plus, you can just hover over something for the fully qualified name.
这篇关于是完全合格的命名vs使用指令只是一个意见的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!