5 ms·
but even in a language that uses symbols for operators, one needs to be able to distinguish between values and functions Which is the whole point of sigils in
by kbenson 14y ago
but even in a language that uses symbols for operators, one needs to be able to distinguish between values and functions
Which is the whole point of sigils in perl, and a different sigils to denote the different core types. They hint the type for the reader.
Some people are very adverse to the idea of sigils, but really it's like any other bit of syntax in a language, once you know what it is and can pick it out, you can then use it as a useful additional channel of information when reading and writing code (channel of information to future readers of the code, that is).
- lmm 14y agoFirstly, the sigils on variables are only a small part of perl's legendary unreadability; there's also a plethora of operators called things like <=> and ~/, along with a bunch of magic implicit variables ($_ is common enough to be memorable, but it's not the only one). And the sigils are a bad idea for the same reason that operators with sigil names are a bad idea: it creates this artificial distinction between what's built-in and what's user-defined (though in this case we're talking about types rather than methods).