News for hackers. Stuff that matters.
Re:Ask HN: Favorite HN comment(s) by roblabla on Monday May 22, 2017 @07:51PM (#14397768)
let's see... Lack of a real integer type ?

The fact that {} + [], [] + [], [] + {} are all valid and all give different results ? [1]

The fact that it has some silent error conditions like NaN ?

The fact that, in v8 (which is the most common js engine out there), if you add a comment to a function, it can suddenly start performing poorly ?[0]

I love JS, I really do. Hell, I write nodejs for a living ! I find prototypical inheritance to be an awesome idea. The simplicity, and extensibility of the language is something that I really like from it. But I can see where people hating it are coming from. I wish lua had been used instead of JS.

[0]: https://top.fse.guru/nodejs-a-quick-optimization-advice-7353...

[1]: https://www.destroyallsoftware.com/talks/wat

Re:Ask HN: Favorite HN comment(s) by _ar7 on Monday May 22, 2017 @08:21PM (#14397886)
Most of the issues you listed with the language itself are fixed by using either Flow or TypeScript. As for that V8 issue, it's not ideal, but how about just putting comments of that size outside of the function, or not overcommenting functions small enough to be inlined.

I know a lot of people view using so much tooling as a con of the language, but if you use Babel + Eslint + Flow/Typescript, JavaScript becomes a lot nicer and safer to program in. For small to mid-sized projects, I think JavaScript is pretty great.

Re:Ask HN: Favorite HN comment(s) by piedoom on Monday May 22, 2017 @08:48PM (#14397990)
> Most of the issues you listed with the language itself are fixed by using either Flow or TypeScript.

Hence the initial comment about putting effort into fixing something fundamentally broken.

Re:Ask HN: Favorite HN comment(s) by _ar7 on Monday May 22, 2017 @08:59PM (#14398046)
Ah true. I guess what I was really getting at was that even though JavaScript has some fundamental missteps, it's not beyond being fixed and definitely not the worst language in existence i.e. that behind the quirks, is a quite nice and powerful language that isn't a waste of effort.
Re:Ask HN: Favorite HN comment(s) by bushin on Monday May 22, 2017 @09:32PM (#14398162)
NaN stuff works according to the IEEE 754 spec.