Cogman
Lifer
So, I'm somewhat of a C# beginner. My question is this,
In c++ when you have a class, convention is to declare the class in a header and implement the functions in some other file, ie
header
Implementation
Is there a similar convention in C#? While just browsing through code, it look like the common thing to do is to have the implementation be the definition, IE
This sort of just feels wrong as I'm just so use to breaking the two apart. I'm I nuts or is this just convention?
In c++ when you have a class, convention is to declare the class in a header and implement the functions in some other file, ie
header
Code:
class someClass
{
private:
string bob;
public:
void doStuff();
};
Implementation
Code:
void someClass::doStuff()
{
bob = "frank";
}
Is there a similar convention in C#? While just browsing through code, it look like the common thing to do is to have the implementation be the definition, IE
Code:
public class someClass
{
private bob;
public void doStuff()
{
bob = "frank";
}
}
This sort of just feels wrong as I'm just so use to breaking the two apart. I'm I nuts or is this just convention?
Last edited: