On Aug 4, 2013 11:09 AM, "Lorenzo Marcantonio" <[email protected]> wrote: > > During today merge I noticed that some 'new style' variable > declarations: > > function blah() > { > int a = 0; > > // code > > int b = stuff_from_a(a); > > // code > } > > were converted to the traditional: > > function blah() > { > int a = 0; > int b; > > // code > > b = stuff_from_a(a); > > // code > } > > My preference is to try to restrict the scope of a variable (i.e. > declare it at the initialization point); the 'old' style could have the > advantage of seeing from the start all the stuff used. Of course, no > RAII or collaterals from cons/des, the semantic should be the same (I'd > say the compiler would optimize both of these in the same way). > > Is the traditional style preferred for some reason?
I tend also to prefer the limited scope style. So if it was some change I made it was inadvertent, not deliberate. Getting volunteers to do exact performance is always difficult. Just to tune my > writing style > > -- > Lorenzo Marcantonio > Logos Srl > > _______________________________________________ > Mailing list: https://launchpad.net/~kicad-developers > Post to : [email protected] > Unsubscribe : https://launchpad.net/~kicad-developers > More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~kicad-developers Post to : [email protected] Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp

