4 ms·
I feel bad for javascript for it always blamed for the fault of the environment where it lives.
by bagol 7y ago
I feel bad for javascript for it always blamed for the fault of the environment where it lives.
- duxup 7y agoAnd to some extent the acts of bad actors using it. I just got into webdev a year or so ago and on HN and other places the moral panic about JavaScript on the web is endless because some jerks are out there doing it wrong and everyone thinks of their US local news website (those are a mess) when they talk about it ... and they want to throw the baby out with the bathwater. Meanwhile I'm just trying to write some handy web apps that do it right but can't escape the "omg javascript" medium type articles. I wonder if folks write some nasty stuff in C ... do people blame C?
- deleted 7y ago[deleted]
- mishac 7y agoPeople totally blame C (and C++). There's entire classes of use-after-free and buffer flow errors not possible in other languages, which is what leads to people advocating for Rust or Go (or ADA for that matter, though it's obviously not popular anymore).
- peteradio 7y agoPeople complain about c all the time. Javascript is 20% footgun.
- blotter_paper 7y ago> the moral panic about JavaScript on the web is endless because some jerks are out there doing it wrong To be fair, the language allows them to do it wrong by default with all that implicit type conversion and whatnot -- even in the original equality operator! You can write good JavaScript, but you have to purposefully avoid weird behavior that just isn't present in some other modern languages like Python and Ruby. JavaScript had a weird history, got expanded upon accidentally (i.e. through some browser vendor or another deciding to implement something) many times, and has always valued backwards compatability more than languages that feel comfortable expecting the user to install the relevant runtime.
- strbean 7y agoPython has > a = 100 > a is 100 True > a = 1000 > a is 1000 False
- blotter_paper 7y agoCPython stores integers above 256 as individual pieces of data, but a normal Python script doesn't. I think it's technically undefined behavior.
- coldtea 7y agoThe language didn't have other error reporting mechanisms, traces or exceptions, so it was not "the environment where it lived", it was the language itself...
- purple_ducks 7y agohttp://www.devsanon.com/rants/stupid-javascript/ http://www.devsanon.com/rants/stupid-javascript/ Until Javascript removes the stupid from it's language, it will remain an embarrassment to developers. Completely inexcusable.
- reificator 7y ago> http://www.devsanon.com/rants/stupid-javascript/ http://www.devsanon.com/rants/stupid-javascript/ > Until Javascript removes the stupid from it's language, it will remain an embarrassment to developers. Completely inexcusable. From that link: > > typeof NaN > > "number" > > NaN == NaN > > false > > Ok, so the type of Not a Number is a number? And it also does not equal itself? Oh, well. Let’s try equality with other stuff. Compliance with IEEE 754 is stupidity that is completely inexcusable? That NaN is non-reflexive is certainly irritating but a standards-compliant language is expected to adhere to that.
- mr_toad 7y agoMakes sense to me. 1/0 is not the same as 2/0, etc.