4 ms·
No. JavaScript, the core language, is OK. Sure, there are warts, like this, lack of a good module system, and weird type coercions. Most of the bad rap JavaS
by metafunctor 10y ago
No.
JavaScript, the core language, is OK. Sure, there are warts, like this, lack of a good module system, and weird type coercions.
Most of the bad rap JavaScript gets is because it lives in the browser, and the DOM, with all the cross browser issues that come with that. It's not all JavaScript's fault. In fact, most of it is definitely not JavaScript's fault.
- entropy_ 10y agoAt least as far as I'm concerned, the biggest wart of all is variables that are global by default. That just makes no sense at all...
- whostolemyhat 10y agoBut this was fixed with strict mode; this is like criticising Java for not having generics, even though generics were added ages ago. You can still assign/use global variables in the browser, but like the parent says, this is the browser's fault - having to accept old and badly-written code for compatibility reasons.
- kbenson 10y agoMy biggest problem with JavaScript is that I never can seem to wrap my head around the multiple null/undefined type of values and how to correctly test for them, as well as type introspection. Or, more appropriately, my problem with JavaScript is that it makes that confusing, and I use it just infrequently enough that I forget what I learned last time regarding that. Of course, that's not entirely JavaScript's fault, it just doesn't make it very easy.
- erikpukinskis 10y agoI don't really use null at all. I either just check falsiness, or if there's some chance of the variable being a 0 I check for typeof == "undefined".
- woah 10y agoI think the majority of complaints about JavaScript are from people who are forced to use it infrequently, and don't quite remember how to use it.