Live data from Hacker News

Do you really know JavaScript?

javascript-puzzlers.herokuapp.com

31–40 of 73 posts

Re: Do you really know JavaScript?

#32

I really wouldn't draw any larger conclusions about Javascript from these examples or from the results of this test. These are edge cases. every language has them No sane programmer would put anything like these examples in a normal program, and knowing these edge cases doesn't really help you solve problems or get things done. Because you just won't encounter them in real life.

Every language has /some/ edge cases. Javascript is one big broken edge case.

Re: Do you really know JavaScript?

#33

I really wouldn't draw any larger conclusions about Javascript from these examples or from the results of this test. These are edge cases. every language has them No sane programmer would put anything like these examples in a normal program, and knowing these edge cases doesn't really help you solve problems or get things done. Because you just won't encounter them in real life.

Yes, but what other common language besides PHP has so many ridiculous edge cases? None I use.

Re: Do you really know JavaScript?

#36
post #16

Earlier quoted context omitted.

I wouldn't say that. The really nasty bugs come exactly from examples like these. This can save you hours at some point, I had to find some of them the hard way.

typeof is broken. instanceOf is broken. precision arithmetic on floats is broken var hoisting and function scope is a misfeature It's more useful to know those facts than to know the exact result of them in individual contexts well enough to answer a multiple choice question. It's more useful, if you see these examples in real life, to just rewrite them from scratch to not use the broken parts of javascript. Javascri…

Yeap but the most probable way to learn about them is to lose several hours debugging each of them.

I don't think there is other language that comes close to javascript. Ok it's everywhere now, you make a lot of money with it, that's what we have now, but you and others defending it make my ears bleed.

Re: Do you really know JavaScript?

#37

I really wouldn't draw any larger conclusions about Javascript from these examples or from the results of this test. These are edge cases. every language has them No sane programmer would put anything like these examples in a normal program, and knowing these edge cases doesn't really help you solve problems or get things done. Because you just won't encounter them in real life.

Yes, but what other common language besides PHP has so many ridiculous edge cases? None I use.

Perl would likely be the next closest, but even it's nowhere near as bad as PHP and JavaScript are.

Re: Do you really know JavaScript?

#38
post #30

I really wouldn't draw any larger conclusions about Javascript from these examples or from the results of this test. These are edge cases. every language has them No sane programmer would put anything like these examples in a normal program, and knowing these edge cases doesn't really help you solve problems or get things done. Because you just won't encounter them in real life.

I disagree, several of these issues can come in up innocent programs written by less-seasoned practitioners. For example, [] not ==ing [] seems like it would be an incredibly common noob mistake. Some of the auto-conversion rules make certain classes of true bugs difficult to find. And I could see someone from a more 'traditional' OOP background getting bitten by "string" != new String("string") != String("string). I…

No.

Re: Do you really know JavaScript?

#39
post #26

I may be alone in this camp, but I'd actually recommend people read the ES5 spec if they want to be confident in their JS. It's one of the most readable and understandable specifications I've read, and (compared to behemoths like C++) is fairly short. There's even an internally-hyperlinked version at http://es5.github.io .

If you want a readable langauge spec check out http://golang.org/ref/spec

Re: Do you really know JavaScript?

#40
post #15

Holy fuckaroni JavaScript is a mess of a language. I did terrible on this test.

Agreed. I don't want to ever show my score.

Agreed. I already made arrangements to have my things shipped to Alaska where i will live out the rest of my days .. this "programming" thing didn't pan out.
Post reply on HN