Hacker Newsnew | past | comments | ask | show | jobs | submit | pythonautical's commentslogin

> [] + {}

"[object Object]"

> {} + []

0

JS and PHP are the prototypical examples of weak typing.


Again, not sure about PHP. But no, JS is strongly typed. What you've shown there is coercion, not type-punning or anything of the sort.


What do you feel is dishonest about it?


Tragically, yes. I've been in meetings where each of these is brought up as a concern of using Python over a more traditional language like C++ or Java.

This is kind of like debating with creationists -- yes, it is absurd and dumb that the discussion even needs to be had, but they must be challenged.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: