Talk:Header file: Difference between revisions
Derek farn (talk | contribs) →Reverted intro: Please ask questions before reverting |
Quuxplusone (talk | contribs) |
||
Line 56: | Line 56: | ||
--[[User:Quuxplusone|Quuxplusone]] 03:30, 11 June 2007 (UTC) |
--[[User:Quuxplusone|Quuxplusone]] 03:30, 11 June 2007 (UTC) |
||
Oh, well, if you want to ''rebut'' some of my points, I'll make a longer list. :) You say "compiler directive" is not accurate, but you write "intended to be processed by a [[compiler]] when another source file is compiled", which implies that compilers ''are'' being used here. The first sentence of the article is unnecessarily densely worded. The one-sentence paragraphs on which I did not previously comment also contain grammatical errors, which your reversion re-introduced. I disagree that header files are used "to hold automatically generated code", although included ''non''-header files occasionally are. Please do not blindly revert changes; take a look at what's written and see if you can improve it, or use some of its improvements in your own revision. |
|||
Have a nice day! --[[User:Quuxplusone|Quuxplusone]] 17:46, 11 June 2007 (UTC) |
Revision as of 17:46, 11 June 2007
I see little value in creating long articles (and the preprocessor article is only short because it is quite incomplete). Keeping header file separate seems appropriate. Akihabara 14:53, 11 July 2005 (UTC)
- I don't think the resulting article would be long because there is a good deal of overlap between this and C preprocessor. Besides, when the article gets really long in future, we can split it into two. -- Taku 23:39, July 11, 2005 (UTC)
- Indeed it is only short because it is incomplete. It is nonsensical to merge the two, because someone would then have to read through information not related to what they are after. An encyclopedia should give people the information they are looking for efficiently merging these articles would not be efficient. Further joining the articles to then later split them up sounds like a brilliant exercise in wasting time, large corporations would be proud of you. elandra 21:53, 15 July 2005 (UTC)
- I agree. This term certainly stands on its own. There is no reason to combine it with the preprocessor article. Especially since header files are found in other languages other than those using the C preprocessor. Mrmcgibby 23:07, 29 July 2005 (UTC)
- I say keep them seperate.--Lewk_of_Serthic 18:57, August 23, 2005 (UTC)
- Unless someone objects in the next day or so, I'm going to remove the merge notice.--Lewk_of_Serthic 13:50, August 30, 2005 (UTC)
- I was not logged in, but I deleted the merge notice.--Lewk_of_Serthic 19:10, August 31, 2005 (UTC)
examples of header file
copyvio
I think big chunks of this must be a copyvio. Look at this sentence: "Please note that the code segments provided above are in no way the best way to do the projects." Whenever this big slab was inserted, that edit should be reverted. 128.250.37.103 06:46, 11 August 2006 (UTC)
- I wrote the examples from scratch. I was trying to come up with the simplest example that illustrates the point of header files. I might have had a poor attempt at doing so, however there is no copyright infringement. If you find a copy of this example elsewhere, then that might be a copyright infringement against me! Please ask the authors of the articles before making accusations based on your intuitions. Thank you. BardiaM 12:38, December 29 2006 (MT)
Include in programB.c
- I am no expert on the subject, so my question could be silly... but, shouldn't the last programB.c read #include "programA.c" instead of #include "programA.h"? — Isilanes 19:54, 30 April 2007 (UTC)
- No. Header (.h) files are included in other files. C source files (.c), as a rule, are not. Pfaffben 14:17, 2 May 2007 (UTC)
Dubious statement
"interfaces in Java are analogous to C header files" seems suspect to me. The two are surely quite different ideas? — Preceding unsigned comment added by 193.113.57.163 (talk • contribs)
- They're not totally different, in that C header files are typically used to publish public interfaces, and Java interfaces are typically used to describe public interfaces. They are different "parts of speech", so to speak, since header files contain source code, whereas the Java interface is a construct which appears in source code. In any case, I've made massive changes that included deleting that sentence. Java is mentioned farther up the page, with more finesse. :) --Quuxplusone 06:13, 7 June 2007 (UTC)
Reverted intro
- In computer programming, particularly in the C and C++ programming languages, a header file or include file is a file, usually in the form of source code, which is intended to be processed by a compiler when another source file is compiled. The header file is referenced within the source file by using some computer language directive, usually containing the word include. A common convention is that the name of a header file name include the letter h in its suffix, eg., .h, hpp.
My reversion:
- In computer programming, particularly in the C and C++ programming languages, a header file or include file is a file that is automatically included in another source file in order to provide forward declarations for subroutines or variables used in the latter file. Typically, header files are included via compiler directives at the beginning (or head) of the other source file.
Reasons I think the latter is better:
- "usually in the form of source code" — As far as I know, header files are by definition "source code", since they're processed by a compiler (or assembler), and therefore cannot be called "executable code". So this is redundant, but masks its redundancy with the weasel word "usually".
- There is no requirement in C or C++ for headers to be source code (not so sure about other languages) and in some implementations they have the form of a precompiled binary file (this can speed up compilation significantly when headers are large). Derek farn 10:57, 11 June 2007 (UTC)
- "referenced" — is not a word. (Nitpicky, yes.)
- Not a word in whose dictionary? Derek farn 10:57, 11 June 2007 (UTC)
- "using some computer language directive" — "Computer language" is vague (did you mean "programming language"?), and "directive" has a technical meaning that might not be intended here; it's hard to tell. I think a few weasel words are in order here, in addition to the direct wikilink to compiler directive.
- Directive is the term used by many language specifications. The directive article could use some work, otherwise it looks fine to me, the usage is not a compiler directive. Derek farn 10:57, 11 June 2007 (UTC)
- "usually containing the word include" — Improper use of bold HTML tags. "Usually" is a vague weasel word here; the writer might mean "only in C and C++", or "in all languages except Java and Perl", or something in between; I can't tell. It's hard to tell what's "usually" done in programming languages, because the set of programming languages is not well defined.
- Yes, usually is vague here. Some languages use #include, others $include and others %include, and I am sure there are other combinations. The essence is that most contain the letters include (there are a few languages that use other words). Derek farn 10:57, 11 June 2007 (UTC)
- "A common convention is that the name of a header file name include the letter h in its suffix" — Totally ungrammatical. Besides, this is a rule only in C. In C++, the standard headers do not have any file extension (although admittedly most user-defined header files use ".h" as a holdover from C). One (or even one-and-a-half) out of two isn't really "common".
- Ok, it may be ungrammatical, but it is technically correct. Fix the grammar. Derek farn 10:57, 11 June 2007 (UTC)
--Quuxplusone 03:30, 11 June 2007 (UTC)
Oh, well, if you want to rebut some of my points, I'll make a longer list. :) You say "compiler directive" is not accurate, but you write "intended to be processed by a compiler when another source file is compiled", which implies that compilers are being used here. The first sentence of the article is unnecessarily densely worded. The one-sentence paragraphs on which I did not previously comment also contain grammatical errors, which your reversion re-introduced. I disagree that header files are used "to hold automatically generated code", although included non-header files occasionally are. Please do not blindly revert changes; take a look at what's written and see if you can improve it, or use some of its improvements in your own revision.
Have a nice day! --Quuxplusone 17:46, 11 June 2007 (UTC)