3 ms·
Brilliant and actually humorous presentation. At first, I thought it was going to be some nerd deep-dive, but then it really was just a presentation of wats. A
by bmitc 4y ago
Brilliant and actually humorous presentation. At first, I thought it was going to be some nerd deep-dive, but then it really was just a presentation of wats.
And honest to god, how do people program in JavaScript?
- masklinn 4y agoCarefully. These issues pretty much all come down to implicit conversions, which you quickly learn to avoid as it’s usually unhelpful (likely a reason for typescript’s popularity).
- cipheredStones 4y agoJavascript has a lot of weird type coercion behavior, but it's not actually hard to avoid. "Never use ==" and "don't use operators on things if it's not obvious what they would do" gets you pretty much everything you need there. This is not to say that there's nothing else weird going on in Javascript, but the things people show off most as "wow, isn't this weird?!" aren't that consequential.
- jdlshore 4y agoThey use a linter. Linters are an established and commonly-used part of the ecosystem, and entirely prevent these issues.
- jeffhuys 4y agoIn normal development, you don't try to add a number to an object, or two arrays together, for instance. I know people just _want_ to bash JS because it's trendy, but come on.
- ratorx 4y ago> In normal development That’s the problem. This is an unexpected situation and the JS philosophy is to silently do something that tries to make the best of it, rather than e.g. throw an error or warning. I think it’s perfectly reasonable to bash JS for this. This is a direct consequence of the JS design philosophy. This is similar to the memory-safe vs memory-unsafe debate (except IMO, slightly dumber because I can’t personally think of any reason this is the behaviour you would want, whereas there might be performance reasons for memory-unsafe). It is increasing the bar of producing good code, without any actual benefit.