Reply to post: Re: Dear Coders - Rules You Learned in Kindergarten

Crash Google Chrome with one tiny URL: We cram a probe in this bug

AndrueC Silver badge
Boffin

Re: Dear Coders - Rules You Learned in Kindergarten

Yah. I learnt this while developing data recovery software. In that scenario invalid inputs are not just possible they are expected.

Unfortunately you can't stick contractual tests everywhere. That has performance consequences that may outway the risks. The trick is to know where your gateways are so that you can place your gatekeepers.

I'd suggest that they would have been better encapsulating the URI in an object(*) and passing that around instead of passing a string. That way it's obvious where you put the gatekeepers - in the object.

(*)Even if your language isn't object oriented you can still employ the isolation technique and define specific interfaces to underlying data.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019