Campbell Ritchie wrote:
Now that really would start a fightWinston Gutkowski wrote:… should you throw NPE or IllegalArgumentException? …
I think it is NPE if you pass a null and IAE if you pass a “real” argument which has the wrong value. So I think we would agree in this instance.
Junilu Lacar wrote:
As my final note on the discussion about the identity element of max() - after reading the wikipedia entry on the Empty Set, I understand how negative infinity is the identity element for the maximum operator. However, to translate that to "Integer.MIN_VALUE is the identity element of max()" (in the context of collections, where an empty collection can be considered) is not mathematically or logically correct and we should not try to bolster that assertion with a mathematical proof because that would be misleading at best.
Jeff Verdegan wrote:I think you'll find that mathematicians disagree with you here.
Junilu Lacar wrote:
Jeff Verdegan wrote:I think you'll find that mathematicians disagree with you here.
I can check with a couple of them that I know from college (not being facetious, I really do know a couple of Math professors who are big on advanced math, logic, and topology). I let you know what they say.
Junilu Lacar wrote:"It ain't what you don't know that gets you in trouble, it's what you know for sure that ain't so." -- Samuel L. Clemens
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
It does happen. Only rarely, but it does happen.Winston Gutkowski wrote: . . . I tend to agree with Campbell,
Even if OP has left the building, can we return him his thread, please.time to return this thread to its owner (although, like Elvis, he's probably left the building).
Winston
Campbell Ritchie wrote:Even if OP has left the building, can we return him his thread, please.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Junilu Lacar wrote:It is a great discussion. Thanks to all the moderators who, despite differences of opinion and perhaps even agreeing while disagreeing, have kept it very civil and non-confrontational. I think Campbell is right in saying that we probably don't disagree that much, just some differences on the details.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:I think that the division probably comes down to experience. I may be wrong, but Junilu (and this is going to sound patronising, but it's not meant to be) you sound like a young man with a good brain and lots of good ideas; it's just that experience sometimes tells us old farts that dogma, even with the best of intent, can be as brittle as bad code. There's always more than one way to skin a cat; and that certainly holds true in programming.
TDD is a paradigm...
Junilu Lacar wrote:As for TDD, it's a "powerful discipline that helps you organize your code, your tests, and your time"
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:but I could also envision it creating the programming equivalent of an anthill: extremely efficient, and highly adaptive; but not really changing much. Where does the impetus for change come from in In a TDD environment? ... qualify you as a middling fart.
Junilu Lacar wrote:Maybe I'm just a victim of one of my favorite Mark Twainisms but so far I have yet to see convincing proof that Integer.INT_VALUE is unconditionally equivalent to NEGATIVE_INFINITY.
They just can't be the same without resorting to some kind of compromise or the convention that I already said I can accept.
And I just ran a JUnit test:
assertTrue(Double.NEGATIVE_INFINITY < Double.MIN_VALUE) and this passed. I can't think of an equivalent test for Integer.MIN_VALUE that will pass, unless you mix types assertTrue(Double.NEGATIVE_INFINITY < Integer.MIN_VALUE)
Jeff Verdegan wrote:That test and the lack of an equivalent in int has zero bearing on the validity of Integer.MIN_VALUE is the result of max({}) over ints.
Junilu Lacar wrote:
Jeff Verdegan wrote:That test and the lack of an equivalent in int has zero bearing on the validity of Integer.MIN_VALUE is the result of max({}) over ints.
Unless you have better reasoning than "has zero bearing", I remain unconvinced. Integer.MIN_VALUE is a valid value in the range of Integer values so the unqualified statement that "Integer.MIN_VALUE is the identity element of max({}) over Integer" does not calculate for me.
I can believe that "Double.NEGATIVE_INFINITY is the identity element of max({}) over Double" so why should this have no bearing on the believability of the other statement?
Double.NEGATIVE_INFINITY is NOT in the range of Double.MIN_VALUE.Double.MAX_VALUE. How would Integer.MIN_VALUE be any different?
I know you said that nobody is saying anything about unqualified/unconditional but the other assertions you guys have been making read otherwise to me.
Junilu Lacar wrote:That last part about my "life" thing might seem unrelated but I don't see it that way. It's an eventual result of the development values and habits that I have instilled in myself and the people I work with. But maybe I've been blabbering away, totally out of synch with what your were asking.
Isaac Asimov wrote:The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:where the impetus for change comes from? Who provides the "that's funny..." moment?
And just in case you don't know the reference:Isaac Asimov wrote:The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'
Winston
Junilu Lacar wrote:Thanks guys, and sorry for putting you through all that[/b]. I'm sure it must have been exasperating for you to read all my misguided refutations.
@Winston: the most exciting phrase Paul and Jeff will hear from me in this thread: "Eureka!" -- I think I finally got it. Wow, was I thick or what?
Jeff Verdegan wrote:I'm glad you were willing to engage in the discussion without things getting personal. As I'm sure you've realized, a lot of folks here like a good argument...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here