On Mon, Aug 11, 2014 at 11:23 AM, Henrik Lindberg < [email protected]> wrote:
> On 2014-11-08 19:06, Trevor Vaughan wrote: > >> I prefer: >> >> cmd x or return nil >> >> as opposed to, if x then return nil, just because it flows better. >> >> Technically, though, a standard should be standard even if it's a bit >> irritating at times and I think that this one might qualify. >> >> Trevor >> >> >> It depends very much how the methods are phrased and what they do. > And there are several ways to to do that... > > return nil unless it_is_ok? > return nil if bad_things_happened? > > Personally I avoid designing with use of "and"/"or" and would not mind a > bit if they were not allowed anywhere. But I recognize it could be very > irritating for someone that is used to phrasing/organizing code a different > way. > > My vote is to drop "and"/"or" entirely. I also just avoid using them anyway, and in general, I agree with Trevor's notion above that I can live with a little bit of irritation to have a simple, universally applied standard. Kylo -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CALsUZFGoSmXCneNzAGDqThpBfv%2Bm8R9YpFUtb6oMZbz-M5zaJg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
