Click here to Skip to main content
15,915,019 members
Home / Discussions / C#
   

C#

 
GeneralRe: Eject a remote computers CD rom Pin
Dave Kreskowiak19-Apr-10 14:01
mveDave Kreskowiak19-Apr-10 14:01 
Questionwhy move using statement into namespace? [modified][Solved] Pin
yu-jian19-Apr-10 6:33
yu-jian19-Apr-10 6:33 
AnswerRe: why move using statement into namespace? [modified] Pin
dan!sh 19-Apr-10 6:56
professional dan!sh 19-Apr-10 6:56 
GeneralRe: why move using statement into namespace? Pin
PIEBALDconsult19-Apr-10 7:19
mvePIEBALDconsult19-Apr-10 7:19 
GeneralRe: why move using statement into namespace? Pin
yu-jian20-Apr-10 6:52
yu-jian20-Apr-10 6:52 
AnswerRe: why move using statement into namespace? Pin
Luc Pattyn19-Apr-10 7:00
sitebuilderLuc Pattyn19-Apr-10 7:00 
GeneralRe: why move using statement into namespace? Pin
dan!sh 19-Apr-10 7:03
professional dan!sh 19-Apr-10 7:03 
AnswerRe: why move using statement into namespace? [modified] Pin
PIEBALDconsult19-Apr-10 7:16
mvePIEBALDconsult19-Apr-10 7:16 
It will have no effect on the compiled size. The difference in source code size depends on how you indent the code within the namespace.


I'm not a fan of the using directive at all, but if you are using it to define aliases, it allows things like:

namespace MySqlClientStuff
{
    using Connection = System.Data.SqlClient.SqlConnection ;
    ...
}

namespace MyOleDbStuff
{
    using Connection = System.Data.OleDb.OleDbConnection ;
    ...
}


However, those may be better in separate files anyway.
There should be little need for multiple namespaces within one file, so the point is fairly meaningless.

More recently I have started putting the using directives for namespaces that contain my Extension Methods inside the namespace, but that's just me.


P.S. In a further contrarian vein...
Were someone to concatenate a bunch of C# code files into one big file, using directives outside the namespaces would cause trouble.
modified on Monday, April 19, 2010 1:23 PM

Questionhashtable or Dictionary! Pin
Jassim Rahma19-Apr-10 5:36
Jassim Rahma19-Apr-10 5:36 
AnswerMessage Removed Pin
19-Apr-10 5:48
professionalN_tro_P19-Apr-10 5:48 
GeneralRe: hashtable or Dictionary! Pin
Jassim Rahma19-Apr-10 9:16
Jassim Rahma19-Apr-10 9:16 
AnswerRe: hashtable or Dictionary! Pin
PIEBALDconsult19-Apr-10 5:54
mvePIEBALDconsult19-Apr-10 5:54 
GeneralRe: hashtable or Dictionary! Pin
Anindya Chatterjee19-Apr-10 6:08
Anindya Chatterjee19-Apr-10 6:08 
GeneralRe: hashtable or Dictionary! Pin
PIEBALDconsult19-Apr-10 6:23
mvePIEBALDconsult19-Apr-10 6:23 
GeneralRe: hashtable or Dictionary! Pin
Jassim Rahma19-Apr-10 9:19
Jassim Rahma19-Apr-10 9:19 
AnswerRe: hashtable or Dictionary! Pin
dan!sh 19-Apr-10 6:00
professional dan!sh 19-Apr-10 6:00 
GeneralRe: hashtable or Dictionary! Pin
Jassim Rahma19-Apr-10 9:20
Jassim Rahma19-Apr-10 9:20 
AnswerRe: hashtable or Dictionary! Pin
PIEBALDconsult19-Apr-10 9:30
mvePIEBALDconsult19-Apr-10 9:30 
Questionsolution N-tier Pin
toto_201019-Apr-10 2:36
toto_201019-Apr-10 2:36 
AnswerMy Vote of 1 Pin
Keith Barrow19-Apr-10 2:39
professionalKeith Barrow19-Apr-10 2:39 
GeneralRe: My Vote of 1 Pin
toto_201019-Apr-10 5:47
toto_201019-Apr-10 5:47 
AnswerRe: solution N-tier Pin
Calla19-Apr-10 2:41
Calla19-Apr-10 2:41 
GeneralRe: solution N-tier Pin
Stanciu Vlad19-Apr-10 4:59
Stanciu Vlad19-Apr-10 4:59 
GeneralRe: solution N-tier Pin
Xmen Real 19-Apr-10 17:21
professional Xmen Real 19-Apr-10 17:21 
AnswerRe: solution N-tier Pin
Vimalsoft(Pty) Ltd19-Apr-10 3:41
professionalVimalsoft(Pty) Ltd19-Apr-10 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.