Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

wat

Name: Anonymous 2011-08-14 23:38

So in C++ I could do

class A {
    int B();
}

int A::B()
{
    return 1;
}


i.e. I could keep my class definition and the code for the methods separate, but I can't figure out how to do the same thing in C#.  Do I really have to use "partial class A {}" in front of everything?

Name: Anonymous 2011-08-15 0:12

>>3
Your brain is damaged. Different languages do things differently. The more you try to force idioms from one language into another where they do not apply, the more trouble you will run into. Keeping structure and details does not necessarily make things more readable, you only think that because you've been conditioned to think that.

It's always been that way, and there was no reason to take the ability away.

Take a look at Smalltalk, the first object-oriented language. It didn't do it that way. And neither did Pascal/Delphi, on which C# was somewhat based (the designer of C# was the lead architect at Borland who worked on Turbo Pascal and Delphi).

I suggest you follow the old adage: ``When in Rome, do as the Romans do.''

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List