[Standards-JIG] UPDATED: JEP-0118 (User Tune)

Julian Missig julian at jabber.org
Wed Oct 27 21:36:56 UTC 2004


On 27 Oct 2004, at 17:12, Chris Mullins wrote:

> Julian Missig  Wrote:
>
>> So why exactly specify a length of "0" for a stream? It seems rather
>> bizarre and would make more sense to me to just leave the <length>
>> element out completely when length is unknown...
>
> This has been one of the most troublesome areas of dealing with the 
> XML that is XMPP for me.
>
> The nodes (and attributes) not being there, versus the node being 
> there, with a value of "false", or "zero", has been problematic. It 
> complicates server code, SDK code, and client code.
>
> Also, in certain stanzas, the different in behavior between
> <iq />
> <iq from=''/>
> <iq from='me at me.com/>
>
> is signifigant. This is not something I would continue to encourage in 
> the protocol.  It's way too error prone.

I don't know about your Jabber libraries, but I know building a client 
with the ones I've used, saying something like
if (length)
{
   _lbl_length->set_text(length->get_text());
   _lbl_length->show();
}
semantically just makes more sense and feels like cleaner code to me 
than:
if (length && length->get_text() != "0")
{
   _lbl_length->set_text(length->get_text());
   _lbl_length->show();
}

Julian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2102 bytes
Desc: not available
URL: <http://mail.jabber.org/pipermail/standards/attachments/20041027/afdc4170/attachment.bin>


More information about the Standards mailing list