You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by ma...@bestweb.net on 2010/03/11 16:28:26 UTC
Prevalence of -ve values in function parameter/exception ids
How often do people use negative values in function
parameter/exceptions returns? I get the impression that it is strongly
discouraged even though it is permitted by the IDL.
Thanks
Mayan
RE: Prevalence of -ve values in function parameter/exception ids
Posted by Mark Slee <ms...@facebook.com>.
I assume that by values you are referring to field identifiers?
The reason this is strongly discouraged is that when field identifiers are omitted, the compiler applies negative field identifiers in descending order to each field, in the order encountered.
If you use negatives for ALL your parameters, you'll be fine, but if you have a parameter in there with no field identifier and then you make some changes to the others, the assigned identifier for the unspecified field might change.
Basically, it is always best to specify a positive identifier for every single field.
-----Original Message-----
From: mayan@bestweb.net [mailto:mayan@bestweb.net]
Sent: Thursday, March 11, 2010 7:28 AM
To: Thrift Developer; Thrift User
Subject: Prevalence of -ve values in function parameter/exception ids
How often do people use negative values in function
parameter/exceptions returns? I get the impression that it is strongly
discouraged even though it is permitted by the IDL.
Thanks
Mayan
RE: Prevalence of -ve values in function parameter/exception ids
Posted by Mark Slee <ms...@facebook.com>.
I assume that by values you are referring to field identifiers?
The reason this is strongly discouraged is that when field identifiers are omitted, the compiler applies negative field identifiers in descending order to each field, in the order encountered.
If you use negatives for ALL your parameters, you'll be fine, but if you have a parameter in there with no field identifier and then you make some changes to the others, the assigned identifier for the unspecified field might change.
Basically, it is always best to specify a positive identifier for every single field.
-----Original Message-----
From: mayan@bestweb.net [mailto:mayan@bestweb.net]
Sent: Thursday, March 11, 2010 7:28 AM
To: Thrift Developer; Thrift User
Subject: Prevalence of -ve values in function parameter/exception ids
How often do people use negative values in function
parameter/exceptions returns? I get the impression that it is strongly
discouraged even though it is permitted by the IDL.
Thanks
Mayan