On Wed, 19 May 2004, Jacques Paris wrote: > Make the user be a little bit more responsible for what he enters, and save > the programming for the intelligent parts
He who depends on the user to always do the right thing is going to learn that his master work of software engineering will not survive first contact with the users. The original question seemed so simple -- "How can you write a function that can tell if a text string is numeric or not?" But... what if the user enters "00123" or "0.123e-3" or (muhaha) "12 0..34 -99.1"? Admittedly, that last one would only come from a bloody-minded user of the worst sort who should be electrocuted the next time he logs in, but in the meantime, how should your code respond? If you're writing mission-critical applications would you like to see Mike Wallace or Dan Rather in your face with a microphone and a camera asking you why your software coughed up its socks and sank without bubbles while the whole world was watching? Eewww... Perhaps that's a bit worst case scenario, but the point is... no programmer should allow even the most quotidian application to fail just because the user is an idiot or a terrorist. And besides... The question was a challenge as its scope was realized... It was irresistible! - Bill Thoen --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 11851
