Live data from Hacker News

JavaScript at 20

brendaneich.github.io

161–170 of 327 posts

Re: JavaScript at 20

#161

Just imagine what the web would be today if only 3-4 weeks had been spent designing javascript...

Intuitively that makes sense until you reflect that plenty of much worse languages than JavaScript took months or years to design.

Honestly, much as it's a pastime to grumble about the flaws of whatever language we find ourselves using, I suspect if you could rerun history a hundred times, not more than ten of the reruns would give us a better outcome than JavaScript.

Re: JavaScript at 20

#162
post #121

Can someone explain the isNaN part of this slide: http://brendaneich.github.io/ModernWeb.tw-2015/#46 I would expect isNaN("LOL") to be true. Why does he put "true?!", and why does Number.isNaN("LOL") evaluate to false?

probably because NaN has a specific meaning when the value being considered is a number , which "LOL" isn't. If you're calling isNaN, it usually means you're checking explicitly for a number like 1/0, not a string. So really this is a matter of types. Personally I don't see how this solves much, but then again I'm not a JavaScript guy.

Ironically enough, 1/0 is Infinity, which is a valid number, instead you need to use 0/0 to get NaN. Even worse, the rules for NaN aren't specific to JavaScript, but come from the IEEE 754 floating point standard.

Standard NaN is even weirder: http://en.m.wikipedia.org/wiki/NaN

Re: JavaScript at 20

#163

"Haters gonna hate." Anyone claiming that JS is the "worst thing to happen to the web" and/or that some other language would miraculously solve all of the problems present in JS should do the following, "Go create it." Don't whine about the barriers and how a new language would never be adopted because "JS is already everywhere." There are plenty of people already trying to solve this problem by actively doing someth…

ok

I would +1 your username if that were a feature of YC.

Re: JavaScript at 20

#164
post #99

Oh yeah, great, many new features. But could you please fix the damn boolean logic? And while at it, get rid of most implicit conversions. Or forget all those features and bake in a macro system, so that we can fix anything without having to wait for the next ES[N] standard to get adopted.

Deprecating == is probably a good step. Or better yet just turning == into === and removing that. That would cause some chaos thats for sure...

They don't have to remove anything, just repeat what they did with "use strict" but make it, uhh, even stricter. Just a subset of JS which is only the good parts.

Actually "use strict" actually makes JS an almost good language as mistakes are immediately flagged rather than "working anyway." But strict mode doesn't go nearly far enough in my opinion.

I will say for backwards compatibility you're always going to have to write "===" the only thing a flag would do is break "==" on purpose.

Re: JavaScript at 20

#165
post #131

"Haters gonna hate." Anyone claiming that JS is the "worst thing to happen to the web" and/or that some other language would miraculously solve all of the problems present in JS should do the following, "Go create it." Don't whine about the barriers and how a new language would never be adopted because "JS is already everywhere." There are plenty of people already trying to solve this problem by actively doing someth…

I don't believe that someone needs to have a solution in order to observe that there is a problem. The resources available to an individual for creating and reasoning are finite, and as long as one is able to give good reasons why they know that there is a better way, "there is a problem" may still be valuable information.

"Or at a minimum present a well thought out and actionable direction towards the solution."

Re: JavaScript at 20

#166
post #131

Earlier quoted context omitted.

I don't believe that someone needs to have a solution in order to observe that there is a problem. The resources available to an individual for creating and reasoning are finite, and as long as one is able to give good reasons why they know that there is a better way, "there is a problem" may still be valuable information.

If it wasn't widely know that Javascript is a problem, then merely observing that it's a problem instead of trying to provide a solution would be useful. But it's a widely known problem and so complaining does nothing useful. Essentially, at this point in the game, complaining is useless rehashing of a beaten horse.

There's a whole world of problems to fix before you even get to the problem of Javascript.

Right now, the world only has 3.5 base browser engines. Those browser developers have no interest in adding a new standard language like Python, even though more people prefer that to Javascript.

So, if you were to develop a new browser language, you need to build a new browser from scratch, and then move a billion people to it.

Re: JavaScript at 20

#167
Every single presentation of Brendan has this "I made this in 10 days" thing, super annoying. JavaScript is a great example how your career can go pretty well if you're good at selling what you're building, even if it's not very good.

This isn't meant as a "JavaScript sucks" type of comment, but as a "being good at presenting your work is really important" type of comment. Too many really strong engineers aren't good at selling their work, so we end up with JavaScript.

Re: JavaScript at 20

#168
post #97

Earlier quoted context omitted.

Moreover, asm.js effectively already existed, right? It's not quite the same, but it's essentially a formalisation of what emscripten and the like already produced.

Is there anything written that explains this? I sort of got that impression when he talked about how JS was untyped but the js bytecode vm had types.

Modern JS VMs have type-specializing JITs. That's how they make code run fast, basically - they detect types at runtime, and emit efficient code for that.

asm.js just gives them the types, which makes things easier, but it all builds upon the existing power of JS VMs. See e.g. http://kripken.github.io/mloc_emscripten_talk/sotu.html#/16

Re: JavaScript at 20

#169
post #8

I just wish the best language would win, not the accidentally ubiquitous one. And giving a real choice of language would been even better.

It's because the best language is the most ubiquitous one. You can paper over syntactic annoyances and semantic confusion with a mental mind-shift, and once they do, they become barriers to entry for your competitors. You can't paper over an inability to deploy your software in front of a customer. From the POV of "what's a showstopper, vs. what's an annoyance", ubiquity is the most important feature a language can h…

Right. But that doesn't take away from the fact that JS has become ubiquitous strictly by accident. I think M8 is just expressing that frustration.

Re: JavaScript at 20

#170
post #7

Earlier quoted context omitted.

Welcome to the modern web, where bad technologies (JS, HTTP, CSS and others) are developed to the max and declared modern despite always remaining bad technologies

Yeah I liked the web better before HTTP... wat? Are you a gopher fan?

I was alluding to the recent developments leading to HTTP 2
Post reply on HN