Posted Dec 3, 2008 21:44 UTC (Wed) by dlang (✭ supporter ✭, #313)
[Link]
++ can be a different operation than +
just like many languages use * for multiplication and ** for exponents
many languages also support the concept of i++ and ++i as a command to add 1 to i. in python it's valid syntax, but produced unexpected (to many programmers) results.
On the future of Perl 5
Posted Dec 3, 2008 22:05 UTC (Wed) by sbergman27 (guest, #10767)
[Link]
Of course. I doubt there is a language that does not have a pothole or two to fall into for programmers coming from other languages. Niner's "++i" selection was a bit cherry-picked in my opinion. I wonder how Perl's "potholes per mile" figure compares to Python's? I've programmed in both, neither having been my first language, and I have a strong opinion on that matter.
On the future of Perl 5
Posted Dec 3, 2008 22:41 UTC (Wed) by dlang (✭ supporter ✭, #313)
[Link]
in my experiance with perl, if you try a construct from just about any language it will probably work, if it doesn't it will give you a syntax error (whitespace being significant is an exception)
this is both a blessing and a curse.
it's great for writing programs (especially when they really are one use), but it means that if you are looking at programs that other people wrote and have not done any thinking about code style you can run into constructs from many different languages.
On the future of Perl 5
Posted Dec 7, 2008 2:05 UTC (Sun) by madscientist (subscriber, #16861)
[Link]
> And just to make a point:
>
> ---
>> x = "0"
>> y = -x
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> TypeError: bad operand type for unary -: 'str'
> ---
>
> In perl that would have silently become a numeric 0. Oops.
I don't get the point you're trying to make. When or why would Perls' behavior be an "oops"? Or put another way, what problem would this cause in the code?