I like that. Makes total sense. Thanks.
Jill
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Antoine Leca
Sent: 10 December 2004 17:38
To: Unicode
Subject: Re: When to validate?
As a result, your strings are likely to be some stuctures.
Then, it is pretty
Title: RE: When to validate?
Antoine Leca wrote:
As a result, your strings are likely to be some stuctures.
Then, it is pretty easy to add some s_valid flag, and you are done.
Is that a proven technique? I'd say not. The flag would only be valid for as long as the string is not changed. You
Title: RE: When to validate?
Andy Heninger wrote:
Some important things in designing a function API are
o Fully define what the behavior is. With a function like
tolower(), you could leave malformed sequences unaltered;
you could replace them with some substitution character;
you
Here's something that's been bothering me. Suppose I write a function -
let's call it trim(), which removes leading and trailing spaces from a
string, represented as one of the UTFs. If I've understood this correctly,
I'm supposed to validate the input, yes?
Okay, now suppose I write a second
Arcane Jill [EMAIL PROTECTED] writes:
Here's something that's been bothering me. Suppose I write a function
-
let's call it trim(), which removes leading and trailing spaces from a
string, represented as one of the UTFs. If I've understood this
correctly, I'm supposed to validate the input,
Jill,
I think that the best practice is to validate input.
Besides the overhead of revalidating there is the issue of what do you do
with data that contains invalid characters. This has to be handles
explicitly. Once validated all transforms should maintain valid data. If
you also provide a
Arcane Jill wrote:
Here's something that's been bothering me. Suppose I write a function -
[ that process strings in one of the UTFs]
I'm supposed to validate the input, yes?
You are designing the API - you get to choose what it does.
An application as a whole needs to validate external input
Subject: When to validate?
Here's something that's been bothering me. Suppose I write a function -
let's call it trim(), which removes leading and trailing spaces from a
string, represented as one of the UTFs. If I've understood this correctly,
I'm supposed to validate the input, yes?
Okay
Arcane Jill arcanejill at ramonsky dot com wrote:
Here's something that's been bothering me. Suppose I write a function
- let's call it trim(), which removes leading and trailing spaces from
a string, represented as one of the UTFs. If I've understood this
correctly, I'm supposed to validate
Arcane Jill va escriure:
And yet, in an expression such as tolower(trim(s)), the second
validation is unnecessary. The input to tolower() /must/ be valid,
because it is the output of trim(). But on the other hand, tolower()
could be called with arbitrary input, so I can't skip the validation.
10 matches
Mail list logo