All of lore.kernel.org
 help / color / mirror / Atom feed
* still seems to be a pile of "_append +=" stuff in oe-core
@ 2015-11-22 12:04 Robert P. J. Day
  2015-11-23  1:24 ` Robert Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Robert P. J. Day @ 2015-11-22 12:04 UTC (permalink / raw)
  To: OE Core mailing list


  i mentioned this a while back, and it *seems* that there's even more
of this now -- the use of "_append" in conjunction with "+=", which is
clearly(?) redundant.

  one simply needs to run:

$ grep -r "_append.*+=" *

to see how much of that there is. sure, it doesn't hurt, but it's
definitely not good programming practice.

rday

-- 

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

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: still seems to be a pile of "_append +=" stuff in oe-core
  2015-11-22 12:04 still seems to be a pile of "_append +=" stuff in oe-core Robert P. J. Day
@ 2015-11-23  1:24 ` Robert Yang
  2015-11-23  2:05   ` Christopher Larson
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Yang @ 2015-11-23  1:24 UTC (permalink / raw)
  To: Robert P. J. Day, OE Core mailing list

The _append and += are different, so we need either:

var_append = " foo"
or
var_append += "foo"

for example:

var += "foo"
var = "A"

Then var will be "A".

But:
var_append += "foo"
var = "A"

Then var will be "A foo"

On 11/22/2015 08:04 PM, Robert P. J. Day wrote:
>
>    i mentioned this a while back, and it *seems* that there's even more
> of this now -- the use of "_append" in conjunction with "+=", which is
> clearly(?) redundant.
>
>    one simply needs to run:
>
> $ grep -r "_append.*+=" *
>
> to see how much of that there is. sure, it doesn't hurt, but it's
> definitely not good programming practice.
>
> rday
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: still seems to be a pile of "_append +=" stuff in oe-core
  2015-11-23  1:24 ` Robert Yang
@ 2015-11-23  2:05   ` Christopher Larson
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Larson @ 2015-11-23  2:05 UTC (permalink / raw)
  To: Robert Yang; +Cc: OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

On Sun, Nov 22, 2015 at 8:24 PM, Robert Yang <liezhi.yang@windriver.com>
wrote:

> The _append and += are different, so we need either:
>
> var_append = " foo"
> or
> var_append += "foo"
>
> for example:
>
> var += "foo"
> var = "A"
>
> Then var will be "A".
>
> But:
> var_append += "foo"
> var = "A"
>
> Then var will be "A foo"
>

Yes, but _append += is not preferred by convention, it just adds confusion.
When using _append, make the separator explicit.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 1157 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-23  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-22 12:04 still seems to be a pile of "_append +=" stuff in oe-core Robert P. J. Day
2015-11-23  1:24 ` Robert Yang
2015-11-23  2:05   ` Christopher Larson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.