简体   繁体   中英

Different ExactSpelling default between C# and VB.NET. Why?

One of subtle language differences between C# and VB.NET is whether DllImportAttribute , used to invoke Win32 APIs, needs to be applied to methods declared with the trailing 'A' or 'W' character in their identifier (The character stands for ANSI charset or Unicode charset.) More exactly, either language allows either practice, but the default value of the DllImportAttribute.ExactSpelling parameter differs by language .

Now I'm surprised by this because I'm associating C# with more machine-oriented, case sensitive matching of identifiers, and VB.NET with more human-oriented, case insensitive matching of identifiers, and now this is a case where C# allows me a looser matching than VB.NET by default.

What is the logic behind this language difference?

在我看来,如果回顾一下:C ++区分大小写和C#从这种语言中获得了很多,我认为让C ++开发人员更容易切换到C#;)VB.NET从Visual Basic和Basic语言中获得更多

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM