News for hackers. Stuff that matters.
Re:Judge Alsup learns to code and schools Oracle by 6ren on Wednesday May 16, 2012 @07:28AM (#3981543)
You're throwing a generic exception; Bloch's version throws two specific exceptions, together with appropriate information. Java tends to have excellent error reporting.

All this reminds me of people saying that could code stackoverflow or facebook in a weekend. The difference is that rangeCheck actually is trivial - it's just that it's easy to underestimate the work involved in coding something. Even something trivial.

Re:Judge Alsup learns to code and schools Oracle by felipemnoa on Wednesday May 16, 2012 @06:21PM (#3984361)
>>You're throwing a generic exception; Bloch's version throws two specific exceptions, together with appropriate information. Java tends to have excellent error reporting.

I know. I reduced it to one generic exception because that is what the person I was replying to did. Bloch's version is better of course.