tags:

views:

183

answers:

4

For a university assignment in Java the specification requires that

Code Listings: in 10-point Courier New typeface, and in Landscape mode if you have lines that are too long to fit into 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?

+11  A: 

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

Ron

Ron Savage
Somebody seriously wants to get *printouts* for an assignment? Barf.
Carl Norum
Indeed. Very old school!
jon hanson
Red pens works best on paper!
Thorbjørn Ravn Andersen
Thorbjørn, code comments/corrections look best in side-by-side diffs ;) (or even code review tools: http://ostatic.com/blog/open-source-code-review-tools )
viraptor
+4  A: 

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 dir
  enscript -2GrE  $*
Brian Agnew
+1 Haha, beat that.
BalusC
+1  A: 

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.

Dan McGrath
A: 

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

Greg Hewgill
@Greg - I would give the tutor what he asks for. Some battles are not worth fighting. By all means, complain if it makes you feel better but the chances are that it won't make a lot of difference. (OK ... I'm old and cynical ...)
Stephen C
@Stephen C -- No no, I think this also... But I'm young and cynical. But... University academics tend to have preferences for things based on various criteria, not always well defined ("I'd only have to print it myself!")
Dylan Lacey