Re: Please tighten up these 10 lines of Java code
- From: Chris Smith <cdsmith@xxxxxxx>
- Date: Wed, 15 Aug 2007 16:56:26 -0600
metaperl <metaperl@xxxxxxxxx> wrote:
Many thanks for all the helpful replies. I have studied this thread
closely and implemented a few of them. In looking through Norvig's
JScheme (an old 1.4 version), I noticed he abbreviated writing to
output this way:
PrintWriter output = new PrintWriter(System.out, true);
Then he could simply do output.print() or whatever.
If the goal is to avoid typing, why wrap another layer around the
stream?
PrintStream output = System.out;
Yes, PrintStream is deprecated; but it's not like you actually avoid it
by wrapping it in something else. You just pretend like you avoid it,
and I'm not a fan of pretending.
--
Chris Smith
.
- Follow-Ups:
- Re: Please tighten up these 10 lines of Java code
- From: Thomas Hawtin
- Re: Please tighten up these 10 lines of Java code
- References:
- Please tighten up these 10 lines of Java code
- From: metaperl.etc@xxxxxxxxx
- Re: Please tighten up these 10 lines of Java code
- From: metaperl
- Please tighten up these 10 lines of Java code
- Prev by Date: Re: Transgressing the Boundaries: Towards a Transformative Hermeneutics of Copyright and Patent Law?
- Next by Date: Re: Simple example for fomatting output in columns?
- Previous by thread: Re: Please tighten up these 10 lines of Java code
- Next by thread: Re: Please tighten up these 10 lines of Java code
- Index(es):
Relevant Pages
|