why doesnt c# require header files?
serkan sendur
Postaholic
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127
No i posted it to here to have Scott involved in the conversation.
Today he is in good mood. And also i really wonder how c# deals without having header files, if that can be done, why c++ has them, of course it cant be for bothering the programmer.
serkan sendur
Postaholic
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127
Some 20 years ago I programmed in this language
It had the concept of a DEFINITION MODULE(= +-header file) and IMPLEMENTATION MODULE. You could design all your definitions and then let a team of programmers fill in the implementations. It would complile even if not all implementations were filled in.
So you could say FROM Circle IMPORT Draw; to use the Draw procedure, while other procedures like CalculateArea are perhaps not yet implemented!
In C (I believe also in C++) when you include a header file, all of the implementation would be loaded in your program, even if you don't need it. Possible that a smart C or C++ compiler will prune out the code that is not needed afterwards, I dont know.
C# is a modern language and VS is a nice environment to develop in, so who needs headers in the 21th century?
ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
So you think c# is better than c++? if Narue were alive, she would prove you wrong as a well known c++ geek :)
serkan sendur
Postaholic
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127
Did I say anywhere C# was better?
Better in computer languages does not exist, for instance I find this language not bad;)
ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
No i posted it to here to have Scott involved in the conversation.
Today he is in good mood. And also i really wonder how c# deals without having header files, if that can be done, why c++ has them, of course it cant be for bothering the programmer.
When am I not in a good mood!?
Danny -- To the point you made that is also available in C# it is just done a little differently. You can create an assembly full of interfaces (unimplemented methods, just like the header file) and give the assembly to your developers. They can each start implementing their respective methods. I couldn't image developing something like this to be honest. You'll usually miss something along the way. It seems so much easier to just shoot a few emails back and forth and establish the "middle ground" where your code meets up and goes from there. If you forget an interface then you have to go back in and add it, rebuild your assembly, distribute it to the team, hope everyone upgrades and you don't have two different versions of the interface floating around with different signatures, etc. How did this work for you?
Serkan -- I don't know that much about c/cpp to be honest. I 'grew up' on pascal and switched over to pascal with some other archaic languages along the way. I think the thread you posted gives some very good examples:1.To improve build times.
2.To link against code without having the source for the definitions.
3.To avoid marking everything "inline".
Beyond that .. I don't know :(
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
Did I say anywhere C# was better?
Better in computer languages does not exist, for instance I find this language not bad;)
I still write programs on my TI-85 during class sometimes :)
[edit]
"" what DdoubleD said. I read the link after I posted
[/edit]
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735
@Scott No problem whatsoever. We where three guys sitting in a room with 3 computers. We talked to each other. I believe e-mail as we know it now had to be invented...
ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
Text from Wiki -
A header file commonly contains forward declarations of classes, subroutines, variables, and other identifiers. Programmers who wish to declare standardized identifiers in more than one source file can place such identifiers in a single header file, which other code can then include whenever the header contents are required.
The C standard library and C++ standard library traditionally declare their standard functions in header files.
Newer compiled languages (such as Java, C#) do not use forward declarations; identifiers are recognized automatically from source files and read directly from dynamic library symbols. This means header files are not needed.
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
i find this thread so informative. keep posting guys, this is a very useful and enlightening discussion. thanks for your answers.
serkan sendur
Postaholic
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127
i created a thread in geeks lounge "what do you think would be milestone web-social-application?", i would like to hear your opinions about that thread. Thanks in advance.
serkan sendur
Postaholic
2,062 posts since Jan 2008
Reputation Points: 854
Solved Threads: 127