Live data from Hacker News

These are things in PHP which make me sad

phpsadness.com

11–20 of 217 posts

Re: These are things in PHP which make me sad

#11

I've definitely run into #1 on the list. "Paamayim Nekudotayim" is a transliterated version of פעמיים נקודתיים‎, which means "double colon" in Hebrew. Zeev and Andi are Israeli, which kind of explains it, but the error message is still pretty useless.

Even in Hebrew, that is a useless error message...token names should mean what the token means, not what it looks like.

For unexpected token I think what it looks like is more valuable. Unfortunately most English PHP developers don't speak Hebrew. =\

Re: These are things in PHP which make me sad

#12
While it doesn't detract from the point of your post, the behavior of private is correct and intended. If you wish to override an internal method of a class in PHP, like Java, you must declare it protected, not private. This is the difference between private (completely internal, not inherited) and protected (internal, but inherited by subclasses).

Re: These are things in PHP which make me sad

#14

I've definitely run into #1 on the list. "Paamayim Nekudotayim" is a transliterated version of פעמיים נקודתיים‎, which means "double colon" in Hebrew. Zeev and Andi are Israeli, which kind of explains it, but the error message is still pretty useless.

This should disappear soon[1], it seems the patch has been accepted (or is on a good way to be), according the internals@ mailing list[2].

[1] https://wiki.php.net/rfc/improved-parser-error-message

[2] http://news.php.net/php.internals/52436

Re: These are things in PHP which make me sad

#15
post #10

Earlier quoted context omitted.

there's something wrong with the == and coercion in the if() statement in any language. making the switch in if() be a boolean only pushes the problem off to the programmer, who will often choose the wrong function or expression to do the conversion

> making the switch in if() be a boolean only What exactly is the alternative? If there's any problem here it's automatic coercion.

Nothing wrong with automatic coercion, as long as the rules are sane.

In ruby, everything except false and nil is true. Easy.

Unless you override the == method of course. With great power...

Re: These are things in PHP which make me sad

#16
There's a lot of valid points there, but "#33 Cannot override private methods with a subclass" is the right behavior. That's exactly what private is for, and it's important to know that such names are non-colliding and you can rely on their implementation.

Use protected for overridable methods. You shouldn't mock or directly test private methods in unit tests — they're not part of the interface!

Re: These are things in PHP which make me sad

#17
What makes me sad is that people will defend this horrible language to the death, regardless of how many problems there are with it. I don't get it; we know how bad PHP is, so why do people fight so hard?

Oh, and to demonstrate: "PHP has no native Unicode type, no native Unicode handling, and cannot treat Unicode strings as strings." This true statement, composed of three observations about deficiencies in the language, gets me flamed every time I mention it. Why?

Re: These are things in PHP which make me sad

#19
post #3

PHP's single greatest advantage is ubiquity - would love to see a CoffeeScript compiler for PHP that smooths out these issues.

you could say that all other web platforms are blub because they don't see the value that PHP brings to the table.

a total idiot can install PHP and get a system that will meet the performance and reliability needs of 99.5 of web sites out there.

tomcat, mod_perl, the ten different ways people host Ruby sites and all that make a lot more trouble for you. I've run PHP-based web servers for hundreds of sites that have served billions and billions of hits over the years and never once had to restart Apache because an application server got lodged. read that again because if you skip it, you're sysadminning blub.

every other system requires that you make choices, and the truth about choices is that faced with a binary choice there are two common outcomes: (i) a person freezes up like a deer in the headlights or (ii) a person makes a random choice that they're 50% likely to get right. (i)'s probably the better option.

i can complain about things wrong with PHP forever and i've got plenty of reasons to get off the PHP train. however, if you want to kill PHP, it's not enough to attack what's wrong with PHP, you've got attack what's right with PHP... You've got to make a better PHP than PHP.

Re: These are things in PHP which make me sad

#20
post #18

The ridiculously terrible behavior of == is what makes me the saddest. http://www.php.net/manual/en/types.comparisons.php We then have === which does what == is really supposed to do, but even that still sometimes does the Wrong Thing.

Wow, a downvote within 30 seconds of posting?

"php" == 0 returns true, and this makes sense how?

Post reply on HN