5 ms·
To me, it's about how often you encounter these quirks when use the language "intuitively" (very subjective, I know). I encountered dozens of "JS WTF" when lea
by thrdbndndn 3y ago
To me, it's about how often you encounter these quirks when use the language "intuitively" (very subjective, I know).
I encountered dozens of "JS WTF" when learning without actively trying weird things. It's ultimately on me for not understanding the language better, no argument here, but it feels unintuitive.
And for Python, while I agree with most of cases listed in the repo to be indeed WTF (and a very good resource to learn it deeper!), I don't really encounter most of them naturally, other than the implicit string literal concatenation and default mutable arguments.
- moralestapia 3y agoI disagree and think is the other way around. The TFA shows several examples of code that someone learning the language would definitely hit. Most of the time JS "quirks" are due to code that is so complicated that the actual WTF is on why would someone design such code in the first place.
- thrdbndndn 3y agoReally? To me most of JS quirks are things like `(1 == '1') == true`. Or why there are both `for .. of` and `for .. in`. Maybe you're just too familiar with the language to forgot about these things.
- moralestapia 3y agoJust use '===' and all these "quirks" go away. Or learn the proper semantics for false-ish/true-ish (takes about 20 mins.) and you're on the other side. The Python ones are abhorrent, here's a few of them: * the 'is' operator behaving differently, even when called with operands of the exact same type? * (from TFA) # This will print True or False depending on where you're invoking it (python shell / ipython / as a script) (WHAT?!) * No multi-line lambdas because that makes the AST unparseable, literally. Then cover it up with some shit argument about how ackchually is more "pythonic" to only use one line functions, lol.