为了强调或不强调,这是个问题 [英] To underscore or to not to underscore, that is the question

查看:97
本文介绍了为了强调或不强调,这是个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有与没有$ P $ C#中pfixing私有字段用下划线如果二进制版本将是由其他的框架语言消耗任何问题?例如,因为C#是区分大小写的,你可以调用一个领域的富和公共财产富,它工作正常。

Are there any problems with not prefixing private fields with an underscore in C# if the binary version is going to be consumed by other framework languages? For example since C# is case-sensitive you can call a field "foo" and the public property "Foo" and it works fine.

请问这有任何在不区分大小写的语言,如VB.NET的效果,会不会有任何CLS符合(或其他)如果名称只能由外壳区分的问题?

Would this have any effect on a case-insensitive language such as VB.NET, will there by any CLS-compliance (or other) problems if the names are only distinguishable by casing?

推荐答案

这将有的效果。

的编写符合CLS的库的建议,一部分是不能有两个公共/保护的实体只有大小写不同例如,你应该不会

Part of the recommendations for writing CLS-compliant libraries is to NOT have two public/protected entities that differ only by case e.g you should NOT have

public void foo() {...}

public void Foo() {...}

什么你所描述的不是一个问题,因为私人产品不提供给图书馆的用户

what you're describing isn't a problem because the private item isn't available to the user of the library

这篇关于为了强调或不强调,这是个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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