Skip to contentSkip to conversation

still seems to be a pile of "_append +=" stuff in oe-core

DISCUSSION Robert P. J. Day 3 participants 3 messages Nov 22, 2015 – Nov 23, 2015

lore
Share & tools
lore
#0 lore raw

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

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw

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"

Quoted 14 lines · Robert P. J. Day

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

#2 lore raw
Quoted 11 lines · Robert Yang

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

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

for example:

var += "foo"
var = "A"

Quoted 8 lines

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.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics