Live data from Hacker News

JavaScript Is Weird

jsisweird.com

31–40 of 383 posts

Re: JavaScript Is Weird

#32
post #19

0.2 + 0.1 === 0.3 That's not really a JS problem, that's a floating point problem. Plenty of languages will have the same issue. +!![] "" - - "" (null - 0) + "0" Calling these things weird is fair enough but I can't help thinking this is code you'd never actually write outside of the context of a "Look how weird JS is!" post. It's like picking examples from the Annual Obfuscated C Contest to show how hard it is to un…

The site does say so in the introduction

> Even if you're a JS developer, most of this syntax is probably, and hopefully, not something you use in your daily life.

So I think you should look at this site more as something fun you might not have known if you're an js developer than as criticism of js.

That being said, the !!"" isn't that weird of a syntax is it? I see and use the double exclamation mark all the time.

Re: JavaScript Is Weird

#33

> JavaScript is a great programming language, but ... Why are we so afraid to call trash "trash"? It's not attacking the creator, but just how can we make progress if things are not perceived as they are? https://wtfjs.com

Why is it trash? Or is this just like PHP where people are so accustomed to shitting on something that they're completely oblivious to the progress that's actually been made?

I don't understand what this actually contributes to the discussion beyond it being a tired, beaten-down programming meme.

Re: JavaScript Is Weird

#34
post #20

> JavaScript is a great programming language, but ... Why are we so afraid to call trash "trash"? It's not attacking the creator, but just how can we make progress if things are not perceived as they are? https://wtfjs.com

Is javascript any more "trash" than python or ruby? I don't think so.

From what I read on forums, every single piece of technology that's ever been invented is trash according to some self-appointed expert. I doubt I could name a programming language used by more than 100 people about which at least one person hasn't written a crtical comment.

Re: JavaScript Is Weird

#35
post #16

Earlier quoted context omitted.

Loved this video (4mins) of a talk by Gary Bernhardt (CodeMash 2012) on the topic of JS' quirks: https://www.destroyallsoftware.com/talks/wat

Yep, the "wat" talk helped, got 17/25 first try since I recalled some of the weirdness.

> the "wat" talk

so that's what it's called.

Re: JavaScript Is Weird

#36
I have limited knowledge in web development and its history, but why is javascript a first class language in web dev when all I heard is "javascript bad"? Web assembly seems like a much better choice in hindsight where you can choose different language to compile down to wasm.

Re: JavaScript Is Weird

#37
I think a lot of these errors can be fixed with using strict types, aka Typescript.

I've had the same issues with PHP in the past too, which makes me believe that whosoever created these languages had ease of use as a higher priority than strictness, i.e. it's okay to assign bool, int, string to the same variable.. just get the job done.. okay.

On the other end of the spectrum is a programming language like Pascal (or object Pascal which I used for some time) where I had to write so much boiler-plate code that it made a simple job difficult. Maybe good for big projects but checking if email is valid before form submission, it may be too much boiler-plate code for some people with such traditional languages.

Re: JavaScript Is Weird

#38
post #16

> JavaScript is a great programming language, but ... Why are we so afraid to call trash "trash"? It's not attacking the creator, but just how can we make progress if things are not perceived as they are? https://wtfjs.com

Loved this video (4mins) of a talk by Gary Bernhardt (CodeMash 2012) on the topic of JS' quirks: https://www.destroyallsoftware.com/talks/wat

On Twitter he was also talking a lot about his journey into Typescript which I very much enjoyed. Great guy

Re: JavaScript Is Weird

#39

I have limited knowledge in web development and its history, but why is javascript a first class language in web dev when all I heard is "javascript bad"? Web assembly seems like a much better choice in hindsight where you can choose different language to compile down to wasm.

WASM support hasn't been around for long, comparatively - and I'm not sure if there's been any recent headway with DOM manipulation or GC from WebAssembly.

Re: JavaScript Is Weird

#40

if you block JS you get this message > This website is literally about JavaScript. I mean what did you expect, a .NET application? This website is 99.9% poorly optimized and highly questionable JS. And yet, you have JS turned off.

If you open the console to check after you're finished, it says:

"What, are you going to check if the results are accurate? Go ahead "

But if you open it console while doing the test, it says:

"Hey, stop cheating! "

Post reply on HN