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


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

Re: How to handle same sanity checks

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: How to handle same sanity checks
Date 2017-06-24 19:37 +0000
Organization A noiseless patient Spider
Message-ID <oimf1u$ouk$1@dont-email.me> (permalink)
References <87o9tgo0a9.fsf@munus.decebal.nl> <oig626$4rf$1@dont-email.me> <er6rt5FbgtsU2@mid.individual.net> <oilf5m$ls2$1@dont-email.me> <er7c9iFehreU1@mid.individual.net>

Show all headers | View raw


On Sat, 24 Jun 2017 16:46:09 +0200, Robert Klemme wrote:

> 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.
>
Yes, agreed. If all the ranges are the same and are only used in the one 
class there may be some value in a private method (decluttering the code) 
but, and its a big but, I'd feel inclined to have words with the coder if 
all the error messages were the same on the grounds that, if its just one 
variable that is being range checked and is never modified inside the 
class instance, then it should be checked once and either declared as 
final or stored as an immutable object. OTOH if its a set of variables 
that all must pass the same range check, then the error messages must not 
be the same because they are all different errors and so should deserve 
different descriptions.
 
> Your scheme is a whole different story. 
>
Sure. It hasn't needed to be changed for quite some time now in either 
language incarnation, mainly because its proved flexible enough to do 
everything that is needed without modification. FWIW the circular buffer 
got added when we were looking for a single, relatively rare error in a  
highish volume financial network that, if it didn't have said circular 
buffer, would have churned out MB of diagnostics per day and which would 
have been a horror to analyse. Then I remembered the George 3 circular 
buffer trick - as a result, the next time the problem occurred we got a 
few pages of trace log with the problem message all nicely displayed. 
Sometimes circular buffers really are the best answer! And IIRC turning 
it on scarcely affected the system throughput.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

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