Hacker News new | ask | show | jobs
by foobarbecue 1168 days ago
In python, I find it pretty intuitive. It's very convenient to have "do these two objects have the same contents" vs "are these two the same object at the same memory address."

Other language design options are to use pointers / references, be strongly typed or be functional. Seems like you're saying all weakly-typed object-oriented languages are failures?

1 comments

I don't think "===" in PHP is the same as "is" in Python, though? Identity is important (why would you want to check for 0, None, "", etc.. in separate cases, unless you want to?) but I don't think that is what "===" in PHP.
PHP exists in a place where everything's a string (HTTPland). Type coercion makes more sense there.
Oh you're right. I actually was thinking python "is" was written "===" because I got confused with javascript, yikes.

And I don't speak PHP.

Anyway yeah being able to compare identity and equivalence separately seems important.