logoalt Hacker News

frollogastontoday at 12:41 AM3 repliesview on HN

JS is a lot less weird than Python. And Python is what I started with and continue to use half the time. The article missed the most common one, __name__ == "__main__" like wtf


Replies

Revanche1367today at 12:48 AM

I’m not a regular JS user and haven’t touched the language in a long time, but I remember a (popular?) website for teaching modern JavaScript mentioned that some aspect of the function/macro that returns the type of an object was just plain wrong in a specific and important case. This was years ago however, so maybe the problem isn’t there anymore. Anyhow, I added JS to the list mainly because it is known as a badly designed language and Brendan Eich seems to agree.

show 1 reply
hackyhackytoday at 12:53 AM

> JS is a lot less weird than Python.

I challenge you to find Python behaviors as weird and off-putting as anything here: https://wtfjs.com/

show 2 replies
zmgsabsttoday at 1:30 AM

> __name__ == "__main__"

What makes this weirder than other languages detecting if they’re an import or an invoked file?

show 1 reply