4 ms·
> Python falls through because it doesn't have real lambda. No it doesn't. Been using it for about 10 years can't remember being bothered by lacks of "real lam
by rdtsc 12y ago
> Python falls through because it doesn't have real lambda.
No it doesn't. Been using it for about 10 years can't remember being bothered by lacks of "real lambdas"
> There are minor details wrong with JavaScript. Normally you don't encounter them in daily use.
If there would be minor detail we wouldn't have had the "Good Parts" book. And trying to deals with variables in Javascript is pain, var vs no var, what does this do. Really strange weak typing rules.
Adding [] to {} should not produce some random value (what is it NaN or Object), it should throw an exception.
> Few other languages can match it's simplicity.
Wait, were you being sarcastic?
- Karunamon 12y agoI assume you're referring to the "Wat" talk by Gary Bernhardt, here. My question is why does it matter? It's funny and notable behavior, but why is this a problem that a real programmer will face dealing with a real problem? (For reference, [] + [] = "", [] + {} = Object, {} + [] = 0, {} + {} = NaN)
- rdtsc 12y agoBecause it hides errors instead of helping the developer find them
- Karunamon 12y agoAre JS developers often adding empty arrays and empty objects together? This seems more like a corner case than a real issue. (Not snarky - I don't know JS)
- tokenizerrr 12y agoNo. You generally only add numbers and strings together.
- rdtsc 12y agoAs often as any programmers deliberately insert bugs in their code ;-) Those values are usually in variables that and have been set maybe from a backend reply or from the UI at some point. That is just one instance of the sloppy mess of weak typing. Instead of writing a long list of it I just used an example to illustrate.
- gtirloni 12y agoExtreme nonsense behavior from the language you're using. People see that and think "that's just the tip of the iceberg".
- marcosdumay 12y agoIt matters because it shows how incoherent is the Javascript type system, and how easy it is to get biten by it. About Python lambdas, I miss them a lot. But one can not have everything...