Serving the Quantitative Finance Community

 
User avatar
mholm

C# Question

March 10th, 2003, 9:26 am

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?
 
User avatar
Patrik
Posts: 1
Joined: April 15th, 2002, 9:18 am

C# Question

March 10th, 2003, 9:44 am

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.
 
User avatar
FDAXHunter
Posts: 14
Joined: November 5th, 2002, 4:08 pm

C# Question

March 10th, 2003, 11:11 am

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.
 
User avatar
jamesbattle
Posts: 0
Joined: May 12th, 2002, 8:28 pm

C# Question

March 10th, 2003, 12:47 pm

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).
 
User avatar
jens
Posts: 0
Joined: July 14th, 2002, 3:00 am

C# Question

March 10th, 2003, 7:51 pm

See C# Language Future Features.
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

C# Question

March 11th, 2003, 4:59 pm

A good link for which I thank you.
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

C# Question

March 11th, 2003, 5:07 pm

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