5 ms·
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 som
by Revanche1367 22d ago
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.
- frollogaston 22d agoThere are certainly weird things about it, but they're all things you can ignore especially in modern times, whereas in Python you're constantly dealing with it head-on.
- Revanche1367 22d agoTotally agreed there, Python is my main language nowadays because of work but the inconsistencies and lack of some very easy to add syntactic sugar to cover up some of the ugliness (like your example above) in a backward compatible way is constantly irksome and keeps me from really loving my most used tool.
- lukan 22d agoAh yes, nowdays it is even easier, but "Javascript, the good parts" came out 18 years ago already. https://www.oreilly.com/library/view/javascript-the-good/9780596517748/ https://www.oreilly.com/library/view/javascript-the-good/978... Helped me get a more pragmatic approach to use that chaotic mess of a language and environment. Just use what works, ignore the rest (but I also ignored some specific advice from the book and used what worked for me).
- Daishiman 22d agoI'm not sure what world you live in but I remember quite well when prototypical inheritance was The Way in JS to do object-oriented programming. Then they copied the C#/Java syntax for classes. Then they aded a bunch of reactivity with Observable with a ton of quirks. Every single new, large feature in JS has been full of quirks. The same cannot be said for Python; the exceptions are few and far between and more often than not they're not actually exceptions but rather something bound to core language fundamentals which once understood don't present a challenge because there is an actual underlying consistency.
- Izkata 22d agoYou've probably just gotten used to it so you don't notice it anymore: https://github.com/satwikkansal/wtfpython https://github.com/satwikkansal/wtfpython (Note some of these are outdated, but some of those only mention that towards the end of the section rather than the beginning)
- Daishiman 21d agoIf you read it you'll realize that, very much like I said, the Python WTFs have to do with mechanisms that not obvious but are consistent. This is far better than Javascript, where the underlying mechanisms may be superficially obvious in some subset of cases, but are not consistent and generate many special cases.
- frollogaston 21d agoThe Python wtfs are definitely more consistent than the JS wtfs.
- frollogaston 22d ago11 years ago sure. Then the classes they added were syntactical sugar. Observable was never part of JS, it's from the rxjs lib that I avoided cause yeah it's spaghetti. In about the same timeline, Py went from threading to async-await, which created classic blocking vs nonblocking mismatches. The whole 2 to 3 breaking migration was also still a big deal in 2015.
- xigoi 22d agoJavaScript still has many quirks you can’t just ignore, such as sort() using string comparison by default.
- frollogaston 21d agoThat one does suck. I'd get it if < > did the same thing, but it doesn't.