Jump to content

Talk:Copybook (programming)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

PL/I

[edit]

Copybooks may be used in PL/I as well, in fact copybooks seem to be supported in many IBM platform languages. I am not sure we should limit the definition to COBOL.

I agree. That's quite misleading. I've rewritten this extensively to indicate that. T-bonham 10:10, 17 May 2007 (UTC)[reply]

HTML

[edit]

"copy" occurs in HTML? —Preceding unsigned comment added by 205.242.229.36 (talk) 20:06, 6 March 2008 (UTC)[reply]

Java imports

[edit]

Contrary to what is stated in the main article of this topic, in Java, the import statement does not perform the same function as the COBOL COPY statement or the C include statement.

Rather, the Java import statement merely indicates what Java package name will be used to resolve class references that are incompletely-specified - that is, class names within the same Java source file as the import statement that do not have their package names prefixed. —Preceding unsigned comment added by 64.253.165.30 (talk) 22:11, 4 June 2008 (UTC)[reply]

I agree. I'll remove Java from the list. Alksentrs (talk) 02:20, 14 October 2008 (UTC)[reply]

Copybook vs import?

[edit]

Can someone explain just how a copybook/include is actually different from a "modern" import? DEddy (talk) 18:23, 17 November 2008 (UTC)[reply]

A copybook/include inserts the text of another file into the text of the current file during compilation; an import doesn't (it just tells the compiler where it can look for identifiers).
Includes are also a lot easier to break, and they slow down compilation. (I preprocessed a 67 line C program which included windows.h and it became 14044 lines. (This was in wxDev-C++.) The compiler has to read EVERY ONE of these lines every compilation, unless it uses fancy tricks like precompiled headers.)
Alksentrs (talk) 21:17, 18 November 2008 (UTC)[reply]
A copy or include directive inserts the text of a copybook/header file into the text of the program source which is then parsed as if it was part of the original source, whereas an import or using directive inserts external declarations directly into the compiler's symbol table during the parsing of the program source. Imports are typically faster than includes if the compiler retrieves the symbol declarations from a pre-compiled source (e.g., a bytecode .class file) instead of having to parse additional source code. — Loadmaster (talk) 16:32, 12 April 2010 (UTC)[reply]