For a university assignment in Java the specification requires that

Code Listings: in 10-point Courier Newtypeface, and in Landscape mode if youhave lines that are too long to fitinto Portrait mode.

are included in the documentation. The term seem ambiguous to me and it's a bit late to consult my tutor, how would you define "code listings"? Are these method signatures?

4

Best Answer


That just means printing out your java code. :-)

It sounds like they want everything. If that's too much, I would include the major interfaces and implementations. Any utility-type classes may be out-of-bounds if you have too much. But I'd be tempted to include everything, and structure it such that the most important classes and interfaces are presented first.

If you want to present everything nicely (and why not?) check out enscript. It'll print code in courier with syntax highlighting and decent headers/footers etc. Here's my config to print out in landscape with syntax highlighting:

 # -2 = 2 columns# -G = fancy header# -E = syntax filter# -r = rotated (landscape)# syntax is picked up from .enscriptrc / .enscript direnscript -2GrE $*

Sounds like my University, which for Java (and our capstone) wanted every line of coded printed.

If you want it syntax highlighted and are using Netbeans, it has a "print to html" option in the File menu. Otherwise, you could use enscript like Brian suggested.

I would object to submitting actual dead trees and "print" code listings into PDF for submission.