4 ms·
It's so broken strict mode disallows it's use. A very popular JS book (by a very knowledgeable author) simply says "with is so broken it won't be discussed at a
by orf 11y ago
It's so broken strict mode disallows it's use. A very popular JS book (by a very knowledgeable author) simply says "with is so broken it won't be discussed at all".
Maybe there are minor use cases where it's helpful, but for 99% of cases it's just plain bad. Why publicise it if it's not very useful, broken and will cause even experienced developers (not to mention new ones) debugging headaches?
- Klathmon 11y agoIMO sweeping dangerous features under the rug doesn't do anyone any good. Bring them out in the open, talk about why they are useful (or were in the past) and why they are dangerous, talk about what problem they were meant to solve at the time and what the better ways there are now to do it. I'm not going to mourn the loss of `with` if it gets removed from the language, but i'm not going to shove my head in the sand and pretend like it doesn't exist either.