It happens more day by day that I find myself writing or maintaning programs and scripts written in different languages, mixed and interpolated together.
This lead me to appreciate every day more those languages that apply a "sigil" style, where each variable is identified thru a special character (a sigil), such as for instance $var or @array.
The technical reason for having a sigil is often that the parser is simpler, since it is helped by the developer in understanding what looks like a variable and what looks like a bareword or a function. But the final result, at least for me, is that it is much simpler to read a sigil-based language than another one. I cannot explain exactly why and how, but it turns out that looking at a piece code that contains sigils prompt me in the right mood at the right line. Let's say for now that it is just a metter of seeing a sigil that pops up my attention and make me think what the symbol at the cursor is depending on its sigil.
And, it is worth saying, I appreciate the most those languages like Perl where different sigils are used to indicate different things (even if you will end using the scalar $ the most).
Nessun commento:
Posta un commento