Global using?
-
This comes from a comment in a prior post. Global Usings – A Look at New Language Features in C# 10 | The .NET Tools Blog[^] "With C# 10 you can use global using directives that the compiler will consider for the whole project" To me this is just going to lead to similar problems as in C++ where one puts all of their includes in one include file and then uses that single include file everywhere. It is indeed convenient. But that doesn't mean that it should be used. Nor should it even exist. When looking at a single source file one shouldn't need to be concerned about the impact that other files might have.
-
This comes from a comment in a prior post. Global Usings – A Look at New Language Features in C# 10 | The .NET Tools Blog[^] "With C# 10 you can use global using directives that the compiler will consider for the whole project" To me this is just going to lead to similar problems as in C++ where one puts all of their includes in one include file and then uses that single include file everywhere. It is indeed convenient. But that doesn't mean that it should be used. Nor should it even exist. When looking at a single source file one shouldn't need to be concerned about the impact that other files might have.
jschell wrote:
When looking at a single source file one shouldn't need to be concerned about the impact that other files might have.
That's probably an unrealistic ideal. :) For example, the project file controls the C# language level, which can fundamentally change the meaning of the code in your C# files. The project file determines which assemblies/packages you're referencing, which can also change the meaning and/or behaviour of the code. Even going back to VB6, IIRC there was a project level "option base" setting which would change the default lower bound for array declarations which didn't explicitly specify one.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
This comes from a comment in a prior post. Global Usings – A Look at New Language Features in C# 10 | The .NET Tools Blog[^] "With C# 10 you can use global using directives that the compiler will consider for the whole project" To me this is just going to lead to similar problems as in C++ where one puts all of their includes in one include file and then uses that single include file everywhere. It is indeed convenient. But that doesn't mean that it should be used. Nor should it even exist. When looking at a single source file one shouldn't need to be concerned about the impact that other files might have.