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.

"" is a legal string literal in every language
I know of. It can be used as a key in a map or hash table. It can be
compared with other strings. There is no string operation in any
language I know that will throw NotAString if you apply it to "".

Those are fair points and I withdraw the point I made about not being a 'value', since that has a specific technical meaning and as you point out the empty string would clearly qualify.

However I still believe that logically an empty string and null are two different ways of not supplying any information. I don't consider either as acceptable if an item of data is stated as being required.

However, from the practical point of view...

This is very practical. Interoperability is about agreeing on a type
system. A "type" defines a range of legal values. The AMQP type system
includes empty string and 0-length binaries as legal values for those
types. We absolutely cannot treat any legal value in an exceptional way
unless that is clearly mandated by the spec.

The wording in the spec could certainly be more precise on the point. To me it is still clear, but we will not reach agreement on that.

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.

Reply via email to