| | |
why doesnt c# require header files?
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
i wonder it, because i hate c++ header files. if c# compiler has a way of getting rid of them, why cant c++ do?
here some similar info but i am not satisfied.
http://stackoverflow.com/questions/1...te-header-file
here some similar info but i am not satisfied.
http://stackoverflow.com/questions/1...te-header-file
Due to lack of freedom of speech, i no longer post on this website.
•
•
Join Date: Jul 2009
Posts: 938
Reputation:
Solved Threads: 152
•
•
•
•
i wonder it, because i hate c++ header files. if c# compiler has a way of getting rid of them, why cant c++ do?
here some similar info but i am not satisfied.
http://stackoverflow.com/questions/1...te-header-file
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
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.
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.
Due to lack of freedom of speech, i no longer post on this website.
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?
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?
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
Did I say anywhere C# was better?
Better in computer languages does not exist, for instance I find this language not bad
Better in computer languages does not exist, for instance I find this language not bad
Last edited by ddanbe; Sep 24th, 2009 at 5:52 pm.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
•
•
•
•
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.
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".
•
•
Join Date: Jul 2009
Posts: 938
Reputation:
Solved Threads: 152
•
•
•
•
Did I say anywhere C# was better?
Better in computer languages does not exist, for instance I find this language not bad
•
•
•
•
Did I say anywhere C# was better?
Better in computer languages does not exist, for instance I find this language not bad

[edit]
"" what DdoubleD said. I read the link after I posted
[/edit]
Last edited by sknake; Sep 24th, 2009 at 5:56 pm.
![]() |
Similar Threads
- gcc header files and math libary (C++)
- header files missing (C)
- Header files, C++ vs C compiler question (C++)
- Working with header files ??? (C)
- Header files (C++)
- c vs h header files... (C)
Other Threads in the C# Forum
- Previous Thread: Get dataGridView cell style back!!
- Next Thread: Why doesnt c# require make files?
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox client color combobox concurrency control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ globalization httpwebrequest image index input install java label list listbox listener mandelbrot math microsoftc#visualexpress mouseclick mysql networking operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






