I recently stopped using using-statements and instead use the full namespace path of any .net object that I call.
Example:
using System;
namespa
Short answer no: it is the same code that is compiled.
There's no performance impact; it's mostly a stylistic choice. I find that using using
statements reduces the clutter. Plus, with Intellisense, it's easy enough to see the fully qualified namespace.
There is zero performance difference because the compiler ALWAYS puts in the full name - using is only a hint for the compiler, the runtime doesn't know or support that.
However, once you memorize where the objects come from you will look at this as silly and verbose. There is just so much noise and people just know that Path is from System.IO, Console is in System and StringBuilder is in System.Text.
One downside of your approach: Without using, no extension methods outside of the current namespace. Have fun writing System.Linq.Enumerable.Where(inputSequence,...)
instead of just inputSequence.Where(...)
:)
If you disassemble both of this pieces of code and look at IL code, you'll find that compiler always references all the types by it's full names. That is absolutely identical ways to operating types.
I think that this style result in a programmer performance decrease :). I use the using statement and usually it is clear from code to which namespace the class belong. If not, press F12.
Just my 2c.
The only performance hit, is the hit you take to type it all out, and with you or others reading it.
Using statements are to help readability, not really for performance.