sled...@gmail.com writes:
> On Monday, January 22, 2018 at 1:28:06 PM UTC-5, Cecil Westerhof wrote:
>> From my days in bash programming I have the habit of always using
>> braces around variable names. So I do not write $foo, but ${foo}. Two
>> times I was told that this is not done in the tcl world. Is this true?
>> Then I should change my ways. ;-)
>>
>> --
>> Cecil Westerhof
>> Senior Software Engineer
>> LinkedIn:
http://www.linkedin.com/in/cecilwesterhof
>
> Hold on gang...not so quick...
>
> Excellent question.
>
> Consider
> set firstname rick
> set fullname $firstnameHorwitz
> set fullname ${firstname}Horwiz
That was one of the reasons I used it in bash. If the variable
firstnameHorwitz existed, you got another result as when it did not
existed. But that is not the case anymore.
But there where some other reasons also, but I do not remember them
anymore. :'-(
> Furthermore, if you would like to use multi-word variable names, then braces are the way to do it.
And I like to do things 'always' the same way. I remember many years
ago when I visited a family in the middle of nowhere I still locked my
bicycle. They where a bit offended by that. But my reasoning was that
if I did it when it was not necessary, I also did it when it was
necessary. ;-)
By the way if I remember correctly the style-guide says to always use
( and ) in expressions, even when they are not necessary. (Something I
already did.) So that is a bit inconsistent. ;-)