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


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

Re: How to handle same sanity checks

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: How to handle same sanity checks
Date Sat, 24 Jun 2017 16:46:09 +0200
Lines 39
Message-ID <er7c9iFehreU1@mid.individual.net> (permalink)
References <87o9tgo0a9.fsf@munus.decebal.nl> <oig626$4rf$1@dont-email.me> <er6rt5FbgtsU2@mid.individual.net> <oilf5m$ls2$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net rpIMwGIkYnbo+O5Yse6vvQWnU7l7Mx4X/tDBtB/QqZ3t2huT8=
Cancel-Lock sha1:A322fO9JggdsAc47/AdliNnHLMk=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
In-Reply-To <oilf5m$ls2$1@dont-email.me>
Content-Language en-US
Xref csiph.com comp.lang.java.programmer:36713

Show key headers only | View raw


On 24.06.2017 12:33, Martin Gregorie wrote:
> On Sat, 24 Jun 2017 12:06:28 +0200, Robert Klemme wrote:
> 
>> Premature modularization.  That makes only sense if the variability is
>> needed.  Since this is a private method (which should be static btw.) I
>> would only do the minimum what is needed.
>>
> Since almost every program I write has a need for both error reporting
> and diagnostic tracing *and* past experience has shown that a well
> thought out diagnostic tracing scheme remains valuable when code is in
> production, you won't be surprised to hear that I have similar facilities
> for use in both C and Java. In the Java case its a single class capable
> of direct output via the error channel but that also has the ability to
> accumulate the last 'n' tracing messages in a circular buffer and to
> output them if an error is being reported (I swiped this idea from a
> mainframe OS, where its ability to show what happened in the last second
> or two before a crash was invaluable).
> 
> So I agree that the stand-alone method is a kludge, while at the same
> time its presence does declutter the code and also serves the useful
> purpose of getting rid of repetitive code. However, something like my
> rather more comprehensive diagnostic and reporting facility is more
> generally useful and reusable.

Maybe my phrasing was ambiguous.  My point is, if it is not used then 
that level of flexibility is superfluous, or rather hurtful.  If all 
ranges and error messages are identical than there is no point in making 
them arguments to a private method which by definition cannot be reused 
outside the class.  If, at some point, more arguments are needed, then 
the usual Java tools will allow to do that change fairly quickly.  Your 
scheme is a whole different story.

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

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


Thread

How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-22 11:10 +0200
  Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-22 10:27 +0000
    Re: How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-22 13:21 +0200
    Re: How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-23 06:51 +0200
    Re: How to handle same sanity checks Robert Klemme <shortcutter@googlemail.com> - 2017-06-24 12:06 +0200
      Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-24 10:33 +0000
        Re: How to handle same sanity checks Robert Klemme <shortcutter@googlemail.com> - 2017-06-24 16:46 +0200
          Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-24 19:37 +0000
  Re: How to handle same sanity checks Andreas Leitgeb <avl@logic.at> - 2017-06-22 11:26 +0000
    Re: How to handle same sanity checks Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-22 07:44 -0400
      Re: How to handle same sanity checks Andreas Leitgeb <avl@logic.at> - 2017-06-22 12:30 +0000
  Re: How to handle same sanity checks Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-22 07:40 -0400
    Re: How to handle same sanity checks v_borchert@despammed.com (Volker Borchert) - 2017-06-22 18:33 +0000
      Re: How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-23 06:48 +0200
        Re: How to handle same sanity checks Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-23 09:57 -0400
          Re: How to handle same sanity checks Cecil Westerhof <Cecil@decebal.nl> - 2017-06-23 16:31 +0200
            Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-23 17:21 +0000
              Re: How to handle same sanity checks Eric Douglas <e.d.programmer@gmail.com> - 2017-06-26 05:21 -0700
                Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-26 13:34 +0000
                Re: How to handle same sanity checks Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-26 15:22 +0000
        Re: How to handle same sanity checks Arne Vajhøj <arne@vajhoej.dk> - 2017-06-25 22:55 -0400
  Re: How to handle same sanity checks Marcel Mueller <news.5.maazl@spamgourmet.org> - 2017-06-22 23:07 +0200
  Re: How to handle same sanity checks Joerg Meier <joergmmeier@arcor.de> - 2017-06-25 09:52 +0200
  Re: How to handle same sanity checks Robert Klemme <shortcutter@googlemail.com> - 2017-06-25 12:31 +0200
    Re: How to handle same sanity checks Arne Vajhøj <arne@vajhoej.dk> - 2017-06-25 14:23 -0400
      Style police (Was: Re: How to handle same sanity checks) Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-25 17:28 -0400
        Re: Style police (Was: Re: How to handle same sanity checks) Arne Vajhøj <arne@vajhoej.dk> - 2017-06-25 19:14 -0400
        Re: Style police (Was: Re: How to handle same sanity checks) Arne Vajhøj <arne@vajhoej.dk> - 2017-06-25 19:19 -0400
          Re: Style police (Was: Re: How to handle same sanity checks) Robert Klemme <shortcutter@googlemail.com> - 2017-06-26 23:34 +0200

csiph-web