3 ms·
I see dollar signs for variable names in there ... it is 2021 ... have we learnt nothing?
by ur-whale 5y ago
I see dollar signs for variable names in there ... it is 2021 ... have we learnt nothing?
- gizdan 5y agoWhat's wrong with dollar signs for variable names?
- ivanche 5y agoI'd argue it's not dollar signs for variable names but dollar signs in variable names.
- HelloNurse 5y agoAs you should expect, there's a reason: distinguishing variables of the script from names within the JSON document and from numerous keywords and builtin stuff. Variables get a sigil because in normal code they are a minority of the names.
- jolmg 5y agoYup. Same with shells. Sigils on variables are so we don't need to quote every argument/option on every command. And we don't want to quote our strings in the shell because different to other programming languages, shells are for interactive use and so string literals are far more frequent than variables.