3 ms·
In regard to his "objects compare higher..." point, I think he was referring to this: class MyClass {} class YourClass {} $myclass = new MyClass()
by ceol 14y ago
In regard to his "objects compare higher..." point, I think he was referring to this:
class MyClass {}
class YourClass {}
$myclass = new MyClass();
$yourclass = new YourClass();
var_dump($myclass > $yourclass); // false
var_dump($myclass < $yourclass); // false?
In regard to his "there's no pass-by-object identity..." point, there's no way to do this:
class MyClass {}
$myclass = MyClass;
$anotherclass = $myclass();
I really don't have the energy to refute the rest, but most of them are relatively subjective. (I say relatively because most of them promote better programming, but their absence doesn't directly harm)
- wvenable 14y ago> In regard to his "objects compare higher..." point, I think he was referring to this: That all comparisons between objects, except equals and strict equals, return false doesn't seem terribly unreasonable. > In regard to his "there's no pass-by-object identity..." point, there's no way to do this: class MyClass {} $myclass = new ReflectionClass('MyClass'); $anotherclass = $myclass; $instance = $anotherclass->newInstance(); $myclass = 'MyClass'; $instance = new $myclass(); > I really don't have the energy to refute the rest, but most of them are relatively subjective. I think you'll be hard pressed to find too much fault with my criticisms of that article. The author doesn't even know common language terms like private/public/protected. And clearly he's never even seen C++.
- ceol 14y ago> return false doesn't seem terribly unreasonable. It should throw an error, not return false. This goes back to PHP's "try as hard as possible to run the script" mentality. The author doesn't need to know C++ to comment on PHP's failings, does he? And he knows private/public/protected— you even quote him using them. You're probably not familiar with Python, but there aren't any private methods (aside from double underscored-prefixed methods, but that's not entirely the same). That's where he was coming from. It's not that he doesn't know those terms; it's that he thinks that's how they should work. Judging by your other responses, you're quick to toss out whether someone is a "PHP programmer" or not, as if that has any bearing on their argument. I'll tell you right now, I work in PHP five days a week, and I agree with most all of eevee's points.
- wvenable 14y ago> It should throw an error, not return false. This goes back to PHP's "try as hard as possible to run the script" mentality. I don't disagree. Although I think this goes towards PHP weak typing not it's try as hard to run the script. > It's not that he doesn't know those terms; it's that he thinks that's how they should work. He thinks they shouldn't exist at all. Which is one philosophy but that's not a valid criticism. > I'll tell you right now, I work in PHP five days a week, and I agree with most all of eevee's points. Even where he clearly doesn't know what he's talking about and didn't try the code he was supposedly saying doesn't work? Those who don't know their tools are bound to have more problems or believe things that are just wrong.