Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Transclusion
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Origins== The concept of reusing file content began with computer programming languages: [[COBOL]] in 1960,<ref>{{Cite book|url=http://bitsavers.trailing-edge.com/pdf/codasyl/COBOL_Report_Apr60.pdf#page=56|title=Initial Specifications for a COMMON BUSINESS ORIENTED LANGUAGE (COBOL) for Programming Electronic Digital Computers|date=April 1960|publisher=Department of Defense|location=Washington|pages=V-27|quote=INCLUDE: Function: To save the programmer effort by automatically incorporating library subroutines into the source program.}}</ref> followed by [[BCPL]], [[PL/I]], [[C (programming language)|C]],<ref>{{Cite journal <!-- Citation bot bypass-->|last=Ritchie|first=Dennis M.|author-link=Dennis Ritchie|date=1993-03-01|title=The development of the C language|journal=ACM SIGPLAN Notices|language=EN|volume=28|issue=3|pages=201–208|doi=10.1145/155360.155580|url=https://dl.acm.org/doi/abs/10.1145/155360.155580|archive-url=https://web.archive.org/web/20200227090139/https://dl.acm.org/doi/abs/10.1145/155360.155580|archive-date=27 February 2020|quote=Many other changes occurred around 1972-3, but the most important was the introduction of the [[C preprocessor|preprocessor]], partly at the urging of Alan Snyder [Snyder 74], but also in recognition of the utility of the the[sic]<!--Original source has the duplicate word! --> file-inclusion mechanisms available in [[BCPL]] and [[PL/I]]. Its original version was exceedingly simple, and provided only included files and simple [[Sed#Substitution command|string replacements]]: [[Include directive|#include]] and #define of parameterless macros. Soon thereafter, it was extended, mostly by [[Mike Lesk]] and then by John Reiser, to incorporate [[Macro (computer science)#Parameterized macro|macros with arguments]] and [[conditional compilation]]. The preprocessor was originally considered an optional adjunct to the language itself.}} [http://www.jslint.com/chistory.html Alt URL] {{Webarchive|url=https://web.archive.org/web/20200204075428/http://jslint.com/chistory.html |date=2020-02-04 }}</ref> and by 1978, even [[Fortran#Transition to ANSI Standard Fortran|FORTRAN]]. An [[include directive]] allows common [[source code]] to be reused while avoiding the pitfalls of [[Copy-and-paste programming|copy-and-paste-programming]] and [[hard coding]] of constants. As with many innovations, a problem developed. Multiple include directives may provide the same content as another include directive, inadvertently causing repetitions of the same source code into the final result, resulting in an [[Syntax error|error]]. [[Include guard]]s help solve this by, after a single inclusion of content, thereafter omitting the duplicate content.<ref>{{Cite book|last1=Stallman|first1=Richard M.|chapter-url=https://scicomp.ethz.ch/public/manual/gcc/6.3.0/cpp.pdf#page=14|title=The C Preprocessor: For gcc version 6.3.0 (GCC)|last2=Weinberg|first2=Zachary|pages=10–11|chapter=Header Files|quote=Alternatives to Wrapper #ifndef : [[C preprocessor|CPP]] supports two more ways of indicating that a header file should be read only once. Neither one is as portable as a wrapper ‘#ifndef’ and we recommend you do not use them in new programs, with the caveat that ‘#import’ is standard practice in [[Objective-C]]. [...] Another way to prevent a header file from being included more than once is with the ‘[[pragma once|#pragma once]]’ directive. If ‘#pragma once’ is seen when scanning a header file, that file will never be read again, no matter what.|author-link=Richard Stallman}}</ref> The idea of a single, reusable, source for information lead to concepts like: [[Don't repeat yourself]] and the [[Abstraction principle (computer programming)|abstraction principle]]. A further use was found to make programs more [[Software portability|portable]]. Portable source code uses an include directive to specify a [[C file input/output|standard library]], which contains system specific source code that varies with each computer environment.<ref>{{Cite journal|last1=Johnson|first1=S. C.|author-link=Stephen C. Johnson|last2=Ritchie|first2=D. M.|author-link2=Dennis Ritchie|date=July–August 1978|title=UNIX time-sharing system: Portability of C programs and the UNIX system|journal=The Bell System Technical Journal|volume=57|issue=6|pages=2021–2048|doi=10.1002/j.1538-7305.1978.tb02141.x|s2cid=17510065|issn=0005-8580|access-date=27 February 2020|url=https://ieeexplore.ieee.org/document/6770409|quote=Even before the advent of the [[Interdata 7/32 and 8/32|Interdata]] machine, it as realized, as mentioned above, that many programs depended to an undesirable degree not only on [[Unix|UNIX]] I/O conventions but on details of particularly favorable buffering strategies for the [[PDP-11]]. A package of routines, called the "[[C file input/output|portable I/O library]]," was written by [[Mike Lesk|M. E. Lesk]] and implemented on the [[Honeywell 6000 series|Honeywell]] and IBM machines as well as the PDP-11 in a generally successful effort to overcome the deficiencies of earlier packages}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Transclusion
(section)
Add topic