Hi Bastian, 

On October 6, 2016 2:09:01 PM GMT+02:00, Bastian Bittorf <b...@npl.de> wrote:
>* Sebastian Moeller <moell...@gmx.de> [06.10.2016 13:48]:
>> It might be not be necessary, but does it hurt? Are you concerned
>that the current practice will hide variables changing their "type"
>from arithmetic and that removing the $ prefix will silence this
>instead of giving an error message? Or does this change improve run
>time of the scripts noticeable? I am just asking, as a non-experts in
>shell coding it seems less error prone to always use
>${VARIABLE_NAME}...
>>
>
>e.g. this case:
>
>A=7
>B=3
>SUM=$(( A + B ))               # correct
>
>instead of SUM=$(( $A + $B ))  # old
>
>it is not about hurting, it's about make the code checkable.
>"every" parser will complain about this mistake, so satisfy them
>and we safe a few bytes 8-)

        Well, this might be correct, but if typical use is $A and the result of 
the computation still 10 then I would rather say the parser needs work. I could 
be wrong, and most likely are, but fixing working code to please a parser seems 
backwards, unless the common usage pattern truly has unwanted side effects. But 
again, I claim no expertise in these matters.

Best Regards
        Sebastian

>
>bye, bastian


_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to