Howdy all, Also, while 3 valued logic is great, it isn't supported that well in Java (until Some/None/Option in Java 8, which helps some). It is also common to use checked exceptions as a 3rd value, but that also has its perils, in my opinion [1].
As mostly a user of JClouds, I'd prefer a runtime exception and primitive return types. Cheers, [1] http://blogs.atlassian.com/2011/05/exceptions_are_bad/ Martin B. Smith, martin.sm...@rackspace.com Direct: 210-312-3274 | Toll Free: 800-961-4454 5000 Walzem Rd. | San Antonio, TX 78218 Rackspace - the open cloud company Ask about our DevOps Automation Service - www.rackspace.com/devops ________________________________________ From: Ignasi Barrera [n...@apache.org] Sent: Wednesday, July 09, 2014 2:48 PM To: dev@jclouds.apache.org Subject: Re: Primitive types in APIs? I generally prefer using primitives where possible, and even more in return types (what does a returned null mean?). Using primitives is in general easier for client applicarions and provide more clear semantics. I really think that avoiding nulls [1] is an extremely helpful practice and we should apply it in our public interfaces, so I prefer using primitives and avoid using nullable objects. I. [1] https://code.google.com/p/guava-libraries/wiki/UsingAndAvoidingNullExplained El 09/07/2014 21:28, "ssiv...@gmail.com" <ssiv...@gmail.com> escribió: > and... there is a such thing as " Three-valued logic" which can be > handful some cases, so I think API should care about semantics... > > On 07/09/2014 07:59 PM, Jeremy Daggett wrote: > >> No particular reason, just for consistency. ;) >> >> On 7/9/14, 9:40 AM, "Andrew Phillips" <aphill...@qrmedia.com> wrote: >> >> We need the APIs to be consistent. >>>> >>> Any particular technical reason for this? Personally, I would be >>> tempted to say "boolean" when it can't be null, and @Nullable Boolean >>> otherwise, but that's just a somewhat context-free style preference. >>> >>> ap >>> >> > -- > Thanks, > Serj > >