|
|
|
|
|
by eevee
4677 days ago
|
|
Hello, author here. You're not the first to scoff at my hammer description, but perhaps you can explain to me what kind of nail puller looks exactly like a hammer but with two claws, or why it would be useful to have the exact same tool on both sides of the handle. (This is still a PHP analogy.) I don't see how to solve most of the issues, either. That sucks, and I genuinely sympathize with Zend on this, but it doesn't make them not-issues. As I think I said, they'd be acceptable if they were reasonable tradeoffs, but many of them are not. Your == counterargument seems apologetic and trivially applied to anything: whenever a program is wrong because the language violated expectations, it's the programmer's fault for not having memorized some matrix of arcane rules. Languages aren't perfect and human beings have wildly differing expectations, but ultimately we only have programming languages to make it easier to express ourselves—no one's stopping you from writing the next big web 2.0 thing in x86 machine code. So yes, when it's difficult to reliably ask a language "are these things the same" without learning paragraphs of gotchas, that's bad. Glad you enjoyed the article! |
|
Talking about == is not trivial or apologetic. That's the way I expect comparison to work in a loosely typed language. I expect 0, 0.0, '0', '0.0', -0, 00, 0x00, null and false to be logically equivalent most of the time. If it also means that if I don't validate input from an http request 0=='0 foodle fish' also evaluates as true, then that's a cost I'm willing to bear.