decoration decoration
Stories

GROKLAW
When you want to know more...
decoration
For layout only
Home
Archives
Site Map
Search
About Groklaw
Awards
Legal Research
Timelines
ApplevSamsung
ApplevSamsung p.2
ArchiveExplorer
Autozone
Bilski
Cases
Cast: Lawyers
Comes v. MS
Contracts/Documents
Courts
DRM
Gordon v MS
GPL
Grokdoc
HTML How To
IPI v RH
IV v. Google
Legal Docs
Lodsys
MS Litigations
MSvB&N
News Picks
Novell v. MS
Novell-MS Deal
ODF/OOXML
OOXML Appeals
OraclevGoogle
Patents
ProjectMonterey
Psystar
Quote Database
Red Hat v SCO
Salus Book
SCEA v Hotz
SCO Appeals
SCO Bankruptcy
SCO Financials
SCO Overview
SCO v IBM
SCO v Novell
SCO:Soup2Nuts
SCOsource
Sean Daly
Software Patents
Switch to Linux
Transcripts
Unix Books

Gear

Groklaw Gear

Click here to send an email to the editor of this weblog.


You won't find me on Facebook


Donate

Donate Paypal


No Legal Advice

The information on Groklaw is not intended to constitute legal advice. While Mark is a lawyer and he has asked other lawyers and law students to contribute articles, all of these articles are offered to help educate, not to provide specific legal advice. They are not your lawyers.

Here's Groklaw's comments policy.


What's New

STORIES
No new stories

COMMENTS last 48 hrs
No new comments


Sponsors

Hosting:
hosted by ibiblio

On servers donated to ibiblio by AMD.

Webmaster
Example of range of variation that is possible | 152 comments | Create New Account
Comments belong to whoever posts them. Please notify us of inappropriate comments.
Example of range of variation that is possible
Authored by: Anonymous on Thursday, April 19 2012 @ 03:37 PM EDT

checkStartAndEnd is not functionally equivalent. It prioritizes the opposite way - out-of-bounds is higher-priority than bad arguments. And it throws the same exception for both out-of-bounds conditions.

On the other hand, this is an internal sanity check. It is not validating user input, it is validating that a programmer has not done something stupid. Therefore in properly functioning code it will never throw any exception. It should only ever be activated during debugging of new code.

[ Reply to This | Parent | # ]

Example of range of variation that is possible
Authored by: tknarr on Thursday, April 19 2012 @ 05:28 PM EDT

AAMAF, IAASD. As a professional programmer, I'd look at the rangeCheck() functions as written and say there's nothing creative there. The functions are required to do 3 checks, and they do them in the obvious order. Any programmer handed this spec is going to do checks in the order they're specified. The code for each check is the minimum allowed by the language to do the check, there's no real alternative way to do the checks without being deliberately stupid about it. The formatting... is the standard formatting for Sun's Java code style, in fact if I fire up Eclipse and do a "reformat file" on that code it's going to end up laid out exactly as it is in these examples. Long and short, the code here's what any programmer given this problem would produce and it's the only reasonable way to do this particular job without introducing deliberate inefficiency and/or stupidity into the code. Trying to copyright this code would be like trying to copyright the standard "gun barrel poking through the gap in a slightly opened door" trope from murder/suspense movies.

[ Reply to This | Parent | # ]

Groklaw © Copyright 2003-2013 Pamela Jones.
All trademarks and copyrights on this page are owned by their respective owners.
Comments are owned by the individual posters.

PJ's articles are licensed under a Creative Commons License. ( Details )