r/ProgrammerHumor • • Aug 26 '20

Python goes brrrr

Post image
59.2k Upvotes

789 comments sorted by

View all comments

Show parent comments

12

u/g0liadkin Aug 26 '20

I mean, that's the biggest pillar of js: it will run most stuff and do its best or yield errors in the console

For some reason people love bringing up examples like adding objects to arrays and saying "omg jabbascreept so random lol"

There are some cases where it's REALLY annoying though — e.g. typeof null being object

1

u/mxzf Aug 26 '20

The issue is that it doesn't yield errors or warnings to the console for a lot of those type of issues.

1

u/g0liadkin Aug 26 '20

What error would you expect?

0

u/mxzf Aug 26 '20

In the case mentioned above, some kind of error about casting a NaN to string. In the more general case of casting between int and string, throwing a warning would be appropriate; a warning doesn't cause the program to break, but it makes the programmer aware that something is going on.

→ More replies (5)