Hacker News new | ask | show | jobs
by __david__ 5609 days ago
> Python and Ruby do them too..

Ruby has decent lambdas/closures, but Python absolutely does not. Its lambas are horrifically limited. Because of that alone, Javascript is a much better at functional programming than Python.

I agree that default global scope is a misfeature, but the solution is trivial--declaring variables--which I think makes the language much more readable anyway. I quite dislike the Python style of coding in which the local variables are just causally used without listing them somewhere--it's too easy for things to get lost. On the other hand, maybe I just need better syntax highlighting? The new "use strict" should completely fix accidental globals, as I understand it.

People complain about the implicit type conversions but I'm not sure I've had that pose a problem in real life and I've written my share of Javascript. I'm not even sure what that kind of bug would look like. I'd love an example.

1 comments

I don't agree with your assessment of python closures. Just because you have to name all inner functions doesn't mean they're not proper closures.