public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Khem Raj <raj.khem@gmail.com>
Cc: OE Core mailing list <openembedded-core@lists.openembedded.org>
Subject: Re: subtle weirdness when you combine "_append" with "+="?
Date: Wed, 17 Aug 2016 09:21:15 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.20.1608170913100.11255@ca624034.mitel.com> (raw)
In-Reply-To: <92B4EF25-FE41-4310-B78A-554EA37BF507@gmail.com>

On Tue, 16 Aug 2016, Khem Raj wrote:

  ... big snip ...

> the _append/_prepend in conjunction with += is a undocumented
> behavior however, I do not see it as much a side effect. But in
> future bitbake may silently change its behavior, so I agree its
> always good to stay in safe waters.

  so just to finalize this discussion, my thoughts on a reasonable and
meaningful standard for append/prepend/etc/etc would be to *always*
use the "mathematical" operators +=/.=/=+/=. except in two situations:

  1) when parsing *must* be delayed until the end, or
  2) when combining the operation with an override (for which i'm
     quite sure there is no equivalent when using +=, etc, right?)

i'm a big fan of simplicity, in the sense that, if an append operation
does not *require* "_append", it shouldn't use it. because if i see an
expression:

  VAR_append = "..."

then i immediately wonder if there is a *reason* for using "_append"
rather than "+=" or ".=", or if that is just the developer's personal
preference. and i really, really, really hate having to guess.

  oh, and of course, never, ever combine "_append" with "+=" or ".=".
does that sound like a reasonable coding style?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




  reply	other threads:[~2016-08-17 13:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16 14:02 subtle weirdness when you combine "_append" with "+="? Robert P. J. Day
2016-08-16 14:46 ` Ulf Magnusson
2016-08-16 15:49   ` Robert P. J. Day
2016-08-16 15:56     ` Ulf Magnusson
2016-08-16 16:39       ` Khem Raj
2016-08-17 13:21         ` Robert P. J. Day [this message]
2016-08-17 14:14           ` Ulf Magnusson
2016-08-17 14:23             ` Robert P. J. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.20.1608170913100.11255@ca624034.mitel.com \
    --to=rpjday@crashcourse.ca \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox