Re: [protobuf] Why not allow null values in Java for scalar types?

2010-12-23 Thread David Yu
On Thu, Dec 23, 2010 at 8:09 AM, Kenton Varda wrote: > There are problems with this: > > 1) Boxing and unboxing primitives is relatively expensive, compared to just > passing them as primitives. If performance matters to you at all (and for > many protobuf users, it does), you probably don't wan

Re: [protobuf] Why not allow null values in Java for scalar types?

2010-12-22 Thread Kenton Varda
There are problems with this: 1) Boxing and unboxing primitives is relatively expensive, compared to just passing them as primitives. If performance matters to you at all (and for many protobuf users, it does), you probably don't want this. 2) If you accept messages from untrusted sources, your

[protobuf] Why not allow null values in Java for scalar types?

2010-12-17 Thread James
I am new to using Protocol Buffers and was really surprised why a compiler option is not available to control how scalar types are mapped in Java when generating the message objects. I understand the concept of having a null int in C++ is not possible, but isn't is really backwards to have to call