Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33220

Re: Never using booleans as parameters

From Kevin McMurtrie <mcmurtrie@pixelmemory.us>
Newsgroups comp.lang.java.programmer
Subject Re: Never using booleans as parameters
References (1 earlier) <boolean-20151120181620@ram.dialup.fu-berlin.de> <564f55e3$0$23775$e4fe514c@news.xs4all.nl> <n2o1vd$os2$1@dont-email.me> <mcmurtrie-D46785.21553023112015@news.sonic.net> <n31o84$umj$1@dont-email.me>
Date 2015-11-27 22:52 -0800
Message-ID <mcmurtrie-936BD0.22522927112015@news.sonic.net> (permalink)
Organization Sonic.Net

Show all headers | View raw


In article <n31o84$umj$1@dont-email.me>,
 Eric Sosman <esosman@comcast-dot-net.invalid> wrote:

> On 11/24/2015 12:55 AM, Kevin McMurtrie wrote:
> > In article <n2o1vd$os2$1@dont-email.me>,
> >   Eric Sosman <esosman@comcast-dot-net.invalid> wrote:
> >
> >   . . .
> >>
> >>       Sometimes, a plain `boolean' is enough documentation:
> >>
> >> 	JFrame frame = ...;
> >> 	...
> >> 	frame.setVisible(true);  // not much doubt here
> >>
> >>       Sometimes, the boolean's meaning is not so clear:
> >>
> >> 	HTMLEditorKit.Parser parser = ...;
> >> 	Reader reader = ...;
> >> 	HTMLEditorKit.ParserCallback callback = ...;
> >> 	parser.parse(reader, callback, false);  // WTF?
> >>
> >>       The third argument to parse() would have been better as an
> >> enum -- but Java didn't have enum's when that API was written.
> >> Cecil Westerhof's suggestion could help:
> >
> > Or you can go with an IDE and well documented code so that you always
> > know what parameters and methods do just by pointing to them.  You gotta
> > have the proper tools of the trade.
> 
>      Here is an ASCII rendering of the Javadoc for this method:
> 
> 	public abstract void parse(Reader r,
>                             HTMLEditorKit.ParserCallback cb,
>                             boolean ignoreCharSet)
>                      throws IOException
> 
> 	Parse the given stream and drive the given callback with the
> 	results of the parse. This method should be implemented to be
> 	thread-safe.
> 
> 	Throws:
> 	    IOException
> 
> ... and that's IT.  The boolean parameter has no documentation beyond
> its name; in fact, none of the three parameters is documented.  Unless
> the IDE has its own private and more complete documentation to draw
> upon, it will have very little explanatory power.

Looks fine to me.  If I need to know the innards, I could hit meta-t in 
Eclipse to see various implementations.

 
> > I hate working with people coding from crude syntax coloring apps
> > because refactoring and cleanup is so much effort for them that they
> > don't do it.
> 
>      "Crude?"  Ye gods!  Something in me would just love to see what
> a few hours' struggling with a keypunch would do to your attitudes ...
> You don't know how good you've got it, laddie.

I used to write programs with a chart of hexadecimal codes for CPU 
instructions.  There was a time for that just as there was a time for 
syntax highlighters.  The scale of typical computer programs has moved 
way beyond that.  It's very difficult to get both the big picture and 
the small details correct without an IDE today.

-- 
I will not see posts from astraweb, theremailer, dizum, or google
because they host Usenet flooders.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Never using booleans as parameters Cecil Westerhof <Cecil@decebal.nl> - 2015-11-20 09:29 +0100
  Re: Never using booleans as parameters Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-20 11:54 +0000
  Re: Never using booleans as parameters Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-20 08:30 -0500
    Re: Never using booleans as parameters Eric Douglas <e.d.programmer@gmail.com> - 2015-11-20 05:57 -0800
      Re: Never using booleans as parameters Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-20 09:17 -0500
  Re: Never using booleans as parameters Eric Douglas <e.d.programmer@gmail.com> - 2015-11-20 05:34 -0800
  Re: Never using booleans as parameters Silvio <silvio@internet.com> - 2015-11-20 18:18 +0100
    Re: Never using booleans as parameters Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-20 16:08 -0500
      Re: Never using booleans as parameters Silvio <silvio@internet.com> - 2015-11-23 14:12 +0100
        Re: Never using booleans as parameters Silvio <silvio@internet.com> - 2015-11-23 14:23 +0100
          Re: Never using booleans as parameters Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-23 08:42 -0500
            Re: Never using booleans as parameters Silvio <silvio@internet.com> - 2015-11-23 15:14 +0100
        Re: Never using booleans as parameters Eric Douglas <e.d.programmer@gmail.com> - 2015-11-23 06:10 -0800
          Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 15:45 -0500
            Re: Never using booleans as parameters Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-30 00:08 +0000
              Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 19:32 -0500
              Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 19:39 -0500
              Re: Never using booleans as parameters Brixomatic <brixomatic@yahoo.com> - 2015-12-20 15:08 +0100
                Re: Never using booleans as parameters Eric Douglas <e.d.programmer@gmail.com> - 2015-12-21 05:00 -0800
                Re: Never using booleans as parameters Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-21 08:53 -0500
            Re: Never using booleans as parameters Gene Wirchenko <genew@telus.net> - 2015-11-30 10:33 -0800
              Re: Never using booleans as parameters Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2015-12-02 15:51 +0200
      Re: Never using booleans as parameters Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2015-11-23 21:55 -0800
        Re: Never using booleans as parameters Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-24 08:23 -0500
          Re: Never using booleans as parameters Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2015-11-27 22:52 -0800
        Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 15:55 -0500
  Re: Never using booleans as parameters leif.roar@dimnakorr.com - 2015-11-20 11:44 -0600
    Re: Never using booleans as parameters Eric Douglas <e.d.programmer@gmail.com> - 2015-11-20 10:08 -0800
    Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-22 14:03 -0500
  Re: Never using booleans as parameters Gene Wirchenko <genew@telus.net> - 2015-11-20 10:14 -0800
    Re: Never using booleans as parameters Eternal Hope <laughingspam99@gmail.com> - 2015-11-22 14:27 +0000
  Re: Never using booleans as parameters Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2015-11-20 20:13 -0800
    Re: Never using booleans as parameters Eric Douglas <e.d.programmer@gmail.com> - 2015-11-23 04:59 -0800
      Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 15:53 -0500
  Re: Never using booleans as parameters galt_57@hotmail.com - 2015-11-22 09:02 -0800
    Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-22 12:20 -0500
  Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-22 12:41 -0500
    Re: Never using booleans as parameters Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-22 18:06 +0000
    Re: Never using booleans as parameters Gene Wirchenko <genew@telus.net> - 2015-11-25 14:21 -0800
      Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 15:58 -0500
        Re: Never using booleans as parameters Gene Wirchenko <genew@telus.net> - 2015-11-30 10:39 -0800
    Re: Never using booleans as parameters Brixomatic <brixomatic@yahoo.com> - 2015-11-29 16:40 +0100
      Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 16:00 -0500
        Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 19:26 -0500
          Re: Never using booleans as parameters Eric Douglas <e.d.programmer@gmail.com> - 2015-11-30 06:16 -0800
  Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-22 14:01 -0500
  Re: Never using booleans as parameters Fredrik Jonson <fredrik@jonson.org> - 2015-11-24 18:50 +0000
  Re: Never using booleans as parameters Sir Hugh Jarce <hugh@example.com> - 2015-11-27 10:07 +0000
    Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 15:49 -0500
  Re: Never using booleans as parameters Brixomatic <brixomatic@yahoo.com> - 2015-11-29 16:33 +0100
    Re: Never using booleans as parameters Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-29 15:57 -0500
      Re: Never using booleans as parameters Arne Vajhøj <arne@vajhoej.dk> - 2015-11-29 16:01 -0500
      Re: Never using booleans as parameters Brixomatic <brixomatic@yahoo.com> - 2015-12-20 15:00 +0100
        Re: Never using booleans as parameters Gene Wirchenko <genew@telus.net> - 2015-12-21 10:50 -0800
    Re: Never using booleans as parameters Gene Wirchenko <genew@telus.net> - 2015-11-30 10:48 -0800
      Re: Never using booleans as parameters Brixomatic <brixomatic@yahoo.com> - 2015-12-20 15:44 +0100
        Re: Never using booleans as parameters Gene Wirchenko <genew@telus.net> - 2015-12-21 10:56 -0800
        Re: Never using booleans as parameters Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-21 15:30 -0500
          Re: Never using booleans as parameters Eric Douglas <e.d.programmer@gmail.com> - 2015-12-21 12:47 -0800
            Re: Never using booleans as parameters Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-21 16:29 -0500

csiph-web