[c#] variables, ifs, simple math and drawing objects

Status
Not open for further replies.
Don't confuse using with includes. Using in C# is nothing but a shortcut and has no impact on performance.

Example:
PHP:
System.Console.WriteLine("You know...");
System.Console.WriteLine("Writing system all the time gets anoying real quick.");
System.Console.WriteLine("That's why 'using' is the best thing since sliced bread!");
Why should we write the System namespace all the time to access the Console class? We don't. So we add:
PHP:
using System;
So we can just:
PHP:
Console.WriteLine("You know...");
Console.WriteLine("Writing system all the time gets anoying real quick.");
Console.WriteLine("That's why 'using' is the best thing since sliced bread!");
We can also create an alias:
PHP:
using System;
using c = System.Console;
To do:
PHP:
c.WriteLine("You know...");
c.WriteLine("Writing system all the time gets anoying real quick.");
c.WriteLine("That's why 'using' is the best thing since sliced bread!");
The closest you'll get to include()/require() in a language like C# is adding references to other assemblies in Visual Studio (well you can load them at runtime or even compile and run source code at runtime but that's on a whole other level, lol).
 
Well if you never start learning your never gonna understand it :p.

582310541_2bfcb04282.jpg
 
yea i understand what you was sating about the "using" keyword. and i know about name-spaces etc and not to be confused with includes etc. just was not sure about the compilation of files, weather theres an include system with C and name-spaces, i understand now that they all below to the one assembly so using would make methods available in that file without using its parents !
 
Status
Not open for further replies.
Back
Top