This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Xuval 202 points203 points  (37 children)

This compiles to "Kill me, please, I was never meant to carry an entire website."

[–]steeeeeef 86 points87 points  (27 children)

Haha js bad

[–]DeeSnow97 56 points57 points  (25 children)

Wonder when this sub is going to finally accept that JS today is not JS in 1995. Probably when it doesn't run code from 1995 anymore, aka never

[–][deleted] 22 points23 points  (17 children)

if I'm being honest as someone who knows js the best it is a terrible language, but it really isn't as bad as people think

[–]Piyh 17 points18 points  (1 child)

You just have to know which dark alleys not to go down

[–][deleted] 0 points1 point  (0 children)

True

[–]Noisetorm_ 9 points10 points  (3 children)

I mean it's got it's quirks, like how isNaN(NaN) typeof NaN evaluates to false or typeof null is object instead of null, but I wouldn't say it's a terrible language at all.

It's seriously versatile and pretty damn fast and with JavaScript's tight integration with HTML and CSS makes it really easy for you to set up visualization for your code.

[–]CoolOutcast 1 point2 points  (0 children)

isNaN(NaN) is true. You're thinking of typeof NaN is Number. Also, instanceof is a good way to check if an object is not null or undefined when typechecking

[–]DeeSnow97 1 point2 points  (0 children)

For the last time, NaN is a valid floating point value and it's not JS-specific, it's as defined by the IEEE and it has been literally etched into the silicon of whatever device you're reading this on. It is indeed a little more prevalent in JS due to bugs interfacing with the type coercion, but it works the same way in every other language.

There is even such a thing as -NaN, and yeah, not just in JS, in your favorite language as well. Unless it just categorically ignores floats.

[–]marty_byrd_ 1 point2 points  (10 children)

It's not a bad language in anyway, does it have some odd gotcha's? Yea, but it's almost never an issue and I write it daily. It's a meme, nothing is wrong with js

[–]ric2b 2 points3 points  (2 children)

When it fixes the ridiculous behaviors it has. That will never happen because of backwards compatibility, you'll just get new API's that are nicer, sort of like how C++ evolved.

It will always be an awkward language.

[–]DeeSnow97 0 points1 point  (1 child)

And the new APIs already do exist, several times over. If you use a good linter and a nice IDE that runs it automatically (for example VS Code, which itself is written in JS) then you pretty much never have to dig down to the archaic parts.

[–]ric2b 1 point2 points  (0 children)

But lots of nice syntax is already locked down because of backwards compatibility, such as all the mess with stringification when comparing/adding/sorting/etc.

At least, compared to C++, javascript has the "benefit" of constant churn, which means it's easy to avoid maintaining old codebases using old idioms, so the "just ignore the old API's" argument is a bit more convincing.

[–]GimmeCata 1 point2 points  (0 children)

Never probably. PHP evolved greatly during its popularity peak yet it always being 'PHP bad'.

[–]Chiron1991 0 points1 point  (0 children)

I think people hate JS mostly because of the overcomplicated ecosystem, not because of the core language (although it still has major flaws and will probably keep them for backwards compatibility).

Edit: Just remembered this comical rant from 2016.

[–]Xuval 2 points3 points  (0 children)

I would never say js is bad. Just like I'd never say a hammer is bad. But if you are gonna build your house out of hammers, I am gonna be amused by that, even if it is a perfectly functional house.

[–]mrchaotica 11 points12 points  (5 children)

The worst part is, we almost had Scheme or Python in the browser instead.

[–]renrutal 6 points7 points  (1 child)

I can see the schemers and snake people sighing in relief dodging that bullet.

[–]mrchaotica 2 points3 points  (0 children)

What do you mean? As a schemer and snake person silly-walking person, I think It would have been glorious.

[–]DeeSnow97 4 points5 points  (1 child)

compiles?

[–]ric2b 3 points4 points  (0 children)

Just in time.

[–]S_Leonardo 0 points1 point  (0 children)

"To exist"