On Thu, 2015-06-11 at 14:45 +0100, Gordon Sim wrote:
> On 06/11/2015 01:54 PM, aconway wrote:
> > On Thu, 2015-06-11 at 13:40 +0100, Gordon Sim wrote:
> > > If a name field is populated with an empty string, that to me is 
> > > the
> > > same as not supplying a name. An empty string is a legal 
> > > encoding,
> > > but
> > > in my view it does not supply a value at all. (It is not like say 
> > > 0
> > > which may be the default but is clearly a value in its own 
> > > right).
> > > 
> > 
> > It is exactly like 0, a perfectly legal value that is often abused 
> > to
> > mean something special.
> 
> It is treated as meaning 'empty' i.e. 'there is nothing here'. I 
> don't 
> consider that abuse myself. 
> If a string is a sequence of chars, the 
> empty string is not a sequence of chars, there are no chars specified 
> in 
> sequence, therefore it clearly is 'special'. The distinction between 
> an 
> empty string and null is an artificial one and in my view anything 
> for 
> that relies on that difference to convey something logically 
> significant 
> is poorly designed.
> 

0 does not mean "there is no number here", even though numbers are for
counting things and 0 means there are no things.  Similarly "" does not
mean "there is no string here" it means there is a string and it is
empty. 

"Abuse" was a poor choice of word - it is fine to assign special
meanings to 0, negative numbers, "" etc. but you have to *say* that in
the API or spec. The spec could have said "a delivery tag is a non
-empty binary" and I would agree with you, but it just says "a delivery
tag is a binary." I also agree that "" is a terrible choice of delivery
tag and we shouldn't ever *use* it (precisely because other people may
not make the distinction) but for interop purposes I think we have to
accept it. Be strict with what you send forgiving with what you
receive.

> In any case there is no harm in handling an empty string as a valid 
> delivery tag (as long as it is unique). I have no objection to that.
> 
> The only part I personally consider important is that proton-c 
> doesn't 
> crash.

Agreed.

Reply via email to