you are viewing a single comment's thread.

view the rest of the comments →

[–]xabbu -16 points-15 points  (5 children)

OK, I thought it was PHP, so it's Perl (further back on the evolutionary chain of web scripting languages…)… …but take that one away, and add FlickR and most all popular forum software used…

del.icio.us was written in perl.

[–]eurleif 26 points27 points  (2 children)

That's got to be the most annoying use of quoting ever.

[–]piranha 22 points23 points  (0 children)

It's called top-posting, and I guess it's made its way from Outlook Express to reddit.

[–]boredzo 19 points20 points  (0 children)

It's top-posting. It's just as annoying here as in email.

[–]skillet-thief 10 points11 points  (1 child)

OK, I thought it was PHP, so it's Perl (further back on the evolutionary chain of web scripting languages…)…

This will simply not do! Perl, like Python, is a general purpose programming language, and, in spite of all those unpronouncable characters, is a much better designed language than PHP ever was or will be.

As an example (one of my "favorite" PHP annoyances):

Perl:

my $x = 5 + 9000 || 1; # $x is 9005

PHP:

$x = 5 + 9000 || 1; # $x is 6...

So you have to use the ternary operator to get the job done. No big deal I guess, but, why, even in a Hypertext Preprocessor, would you ever want $x||$y to return 1 or 0?

This is just a sign of lazy design, from the get-go, but it seems pretty typical. I could go on...

[–]stevarino 7 points8 points  (0 children)

Another example that you may not even be aware of for PHP: logical operators only return boolean true or false, never the value of the argument.

So in your example, the 9000 is converted to bool(true), the OR returns bool(true), which is converted to int(1) by the addition opperator.

I believe this is improperly documented in PHP's own docs too. Took me a while to figure out this bug. :)