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.