4 ms·
> Sigils are for simpler visual parsing - they stand out and mark the 'nouns'. It is not about the compiler - but about people reading the code. I would argue
by azangru 6y ago
> Sigils are for simpler visual parsing - they stand out and mark the 'nouns'. It is not about the compiler - but about people reading the code.
I would argue that python, ruby, javascript and similar languages have demonstrated that it's just as easy to read code without sigils as with them, probably even easier — let alone to write one. Uncle Bob and other evangelists of software craftsmanship suggest clear, descriptive names for variables that would convey their meaning to the reader. As far as I understand, perl programmers also don't dispute the value of meaningful names. At which point using additional twiddles for conveying intent to the reader becomes redundant.
- daotoad 6y agoThe advantage with sigils, that little bit of standardized extra information means that I don't have to do any work to distinguish a verb from a noun. It makes it possible to use names that are just a bit shorter, on average, without sacrificing readability. It's funny to me to see the same people who complain about sigils in perl whole heartedly adopt the Rx convention of naming streams with a tailing $. It's literally just a sigil. Yeah, you put it at the end, but it serves the same exact purpose.
- azangru 6y ago> It's funny to me to see the same people who complain about sigils in perl whole heartedly adopt the Rx convention of naming streams with a tailing $. It's literally just a sigil. This one is a naming convention. Same as how the previous generation of javascript developers used to prepend variable names with a dollar sign if those variables referred to jquery-wrapped objects. Same as starting class names with a capital letter, or using all capitals to name constants. It doesn't have any special meaning for the parser. Your program won't break if you don't follow these naming conventions. It's entirely a style thing.
- daotoad 6y agoSo an unenforced convention that does the same thing as a sigil, but worse. It can't be relied upon because it's not enforced. I've lost count of how many times I've seen streams without their trailing $ in codebases where people were theoretically using them. If you can't rely on the symbol or its absence meaning anything, it's just more punctuation.