Re: Please tighten up these 10 lines of Java code



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
.



Relevant Pages

  • Re: Do it yourself record declicking
    ... to avoid an issue I consider the most important, yet frequently avoided, aspect of transcription from LP to CD-R etc. ... and he doesn't pretend to have done more. ...
    (rec.music.classical.recordings)
  • Re: Please tighten up these 10 lines of Java code
    ... but it's not like you actually avoid it ... by wrapping it in something else. ... You just pretend like you avoid it, ... Perhaps PrintStream should be deprecated, ...
    (comp.lang.java.programmer)
  • Re: How long until unicycling becomes specialized?
    ... get-together and has to pretend to be someone else just to avoid ... NAUCC is being held in my hood next year, come on by and see me quaking ...
    (rec.sport.unicycling)
  • Re: How long until unicycling becomes specialized?
    ... I simply can't wait until AscenXion decides to turn up to a unicycling ... get-together and has to pretend to be someone else just to avoid ...
    (rec.sport.unicycling)