Page 1 of 1

C# Question

Posted: March 10th, 2003, 9:26 am
by mholm
Is there a way to seperate the code in C# like in C++ i.e header and source file? Or is the .cs file the only way?

C# Question

Posted: March 10th, 2003, 9:44 am
by Patrik
I'm by no means an expert on C# (just started reading a book), but from what I have read there is no way to separate definitionand implementation in C#. The .cs file is the only way.

C# Question

Posted: March 10th, 2003, 11:11 am
by FDAXHunter
Patrik is correct. Definition and implementation are in the same file. It wouldn't make much sense otherwise in c#. Unless you are talking about interface declaration and implementation, which can obviously be in a different .cs file.Hope this helps.

C# Question

Posted: March 10th, 2003, 12:47 pm
by jamesbattle
Apparently there is a proposal to allow splitting a class between multiple files (to make iteasier to mix auto-generated code with hand-written code), but it will not support C++style header/source splitting. In any case, the C# way is cleaner. Because files are nevertextually included in other files, splitting the code into a header/source do not make sense.Apparently it's being looked at for release with generics (templates).

C# Question

Posted: March 10th, 2003, 7:51 pm
by jens
See C# Language Future Features.

C# Question

Posted: March 11th, 2003, 4:59 pm
by DominicConnor
A good link for which I thank you.

C# Question

Posted: March 11th, 2003, 5:07 pm
by DominicConnor
JamesBattle is correct, but that doesn't mean you can't do it now.One can invoke the C++ preprocessor on any file, and the object model of VS.Net DevEnv seems up to the task of automating this task.I must confess I' the sort of person who has run the C++ preprocessor on Basic code, so just because I say you can do something, does not imply that you should