2 ms·
I consider unless to be one of my favourite things in perl that would fit into other languages. The key to the multiple ways of doing things is to make code cle
by mst 17y ago
I consider unless to be one of my favourite things in perl that would fit into other languages. The key to the multiple ways of doing things is to make code clearer - you have to look at it not so much as "there's more than one way to do the same thing" as "many things compile down to the same opcodes on the VM".
I suspect in other languages lots of things compile to the same thing -
x = x << 1;
x = x * 2;
should produce the same thing. But if I was affecting a bit vector I'd use the former and if I was affecting a number I'd use the latter - because while the operation at the machine level might be the way, they are conceptually two different things and I want to express the concept to the next developer to look at this code.
The fact that perl intentionally supplies lots of features to allow me to write my code to express my intent as clearly as possible is an advantage to me, just as I find the english language an advantage over, say, lojban.