Re: #include

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 03/25/04


Date: Thu, 25 Mar 2004 07:47:08 -0000

Matt Wisner <mwisner69@comcast.net> wrote:
> I'm new to C# and was wondering what the best practice is for including text
> in source files. Specifically, I have 2 "using x = y;" statements hard-coded
> at the top of all my (13) source files. What is/are the Visual Studio/C#
> Best-Practices for this scenario?

Just include those using statements you need at the top of each file,
and grin and bear it. Don't forget that even if you had include files,
you'd only go down from 2 lines to 1.

As a sidenote, I'd personally recommend just "using Foo;" statements
rather than "using Foo=Bar;" for the sake of readability.

> Is there a C# equivalent to the C/C++ #include directive?

No.

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • Re: Ruger SP101 .357 Ammo Questions.
    ... # different types of ammo. ... In a worst case scenario, it could also be a last ... Then practice, practice, ... color balloons on different sticks at different heights, ...
    (rec.guns)
  • Re: WinXP SP2 firewall
    ... I cannot see how such a scenario could be possible already in theory. ... a "Personal Firewall" ever was useful, compared to best practice. ... "Ich bin ein freier Mensch und werde jetzt von meinen Freiheitsrechten ...
    (comp.security.firewalls)
  • Re: "Ticking" Issue Solved (and I May Stop Using "Neat" Chain Lubricants)
    ... safe and haven't been to the pistol range in at least 3 years now), ... regular practice is a minor component of hitting what ... scenario ends, but of course it would possibly affect the "loon" ... Guns aren't much good in a safe. ...
    (rec.motorcycles)
  • endurance running
    ... This running scenario FAILS in practice, just like you can see from the ... And after all this, the horse WASN'T TIRED AT ALL, ...
    (sci.anthropology.paleo)
  • Tracking events
    ... I thought to create new audit from security tab in Managment studio ... I guess this is much better than writing triggers or using sql server ... Is there some url with best practice for this scenario? ...
    (microsoft.public.sqlserver.programming)