In short examples that do not include using directives, use namespace qualifications. If you know that a namespace is imported by default in a project, you do not have to fully qualify the names from that namespace. Qualified names can be broken after a dot (.) if they are too long for a single line, as shown in the following example.
var currentPerformanceCounterCategory = new System.Diagnostics.
Hey my friend, this is "Tutorials" Section.
Please Tell us what the code mean and define it.
- Rep Power
It's a generic object used to monitor performance within the System.Diagnostics namespace.
Originally Posted by Karizan
I'd say to refrain from using "var" as it's pretty abstract and doesn't blend well with older .Net framework version. (I use 2.0 exclusively for an almost default backwards compatibility on modern system. Standard since some releases of XP SP3)
Not to mention that the compiler is trying to implicitly assign the variable type when using "var", which can easily lead to conversion issues with n00bs.