Hacker News new | ask | show | jobs
by readme 4765 days ago
A better question: Is python really any better than JavaScript? Sure, it has advantages here and there. But there are things I like about JavaScript that are better than python. For example, having anonymous functions that are more than a single expression inside a lambda.

Yes, I know you can declare a function inside another and you get a closure. But, JavaScript's syntax is just nicer.

3 comments

Wow. I had never seen that. There are literally tears streaming down my face I was laughing so hard.
I enjoyed it more this time than I did when I last saw it, perhaps because I was more familiar with the showcased peculiarities last time (the theme is garbage in, garbage out).
In all my Python years, I have never needed to write a long anonymous function. I consider it a bit of a code smell.

This isn't to say it's wrong to do in JS, just that the patterns in Python are different so you don't use this in practice.

I have never needed to write a long anonymous function.

So two line of code is long now?

Yes, as opposed to "short", i.e. a lambda. I'm sorry if my terminology offends you.
JavaScript's syntax being 'nicer' seems pretty subjective.