Print like you mean it

23 September 2008

eclipse enscript java printing

When digging through code, I find it's good to print it out, wander off away from the machine, and do some reading.

But if you print any reasonable-sized chunk of code from Eclipse, you'll be carrying around several reams of paper, since Eclipse apparently thinks we're all blind illiterates.

For the past decade, my friend & mentor Jim Crossley and I have been passing the same encscript alias back and forth. I recently had to request it from him again. (Mental note: put it in SCM somewhere...)

  alias print='enscript --color=blackwhite -E -T4 -M Letterdj -C -2 -fCourier@5/5 -r $*'

It'll spew out your code in landscape mode, syntax-highlighted, two columns of 90 lines each (180 lines total per page), with line-numbers and a nice-looking header.

Many times, this allows you to fit an entire class on a single sheet without any gratuitous wrapping due to Eclipse's 24pt font usage.

F3 is a beautiful thing

12 September 2008

comprehension eclipse java vi

Code comprehension. It's important when you jump into someone else's code.

Eclipse makes it easy, with F3, command-T, and shift-command-G.

Very quickly, you can jump through a maze of classes and interfaces, diving into details or seeing the higher hierarchy. I forgot how nice Eclipse can be. Particularly if you've got the viPlugin.

72 open files (and bless the JBossAS guys for including Eclipse projects and source jars).