20 ms·
JavaScript at 20
- iwwr 11y agoDo you have a video of the presentation?
- deleted 11y ago[deleted]
- Dirlewanger 11y agoCool presentation, but holy shit, taking ~2 minutes to load on FF and freezing the browser is not.
- chimeracoder 11y ago> Cool presentation, but holy shit, taking ~2 minutes to load on FF and freezing the browser is not. Do you have any extensions installed? It took less than 2 seconds to load for me in a blank Firefox profile, which isn't particularly long for any website with a decent number of images on my connection. My only complaint is that the animations make me seasick - I wish there were an obvious way to turn them off.
- M8 11y agoI had same problem on Chrome. Have a lot of extensions, but other websites are fine.
- simfoo 11y agoWelcome 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
- jessaustin 11y agoYeah I liked the web better before HTTP... wat? Are you a gopher fan?
- simfoo 11y agoI was alluding to the recent developments leading to HTTP 2
- jessaustin 11y agoHmmm, my confusion might be because I'm so old that I used gopher before I used the web: it is indeed possible to browse without using HTTP.
- carsongross 11y agoIn fairness, taking 2 minutes to load and freezing the browser is a pretty darned good summary of Javascript at 20.
- talmand 11y agoIn fairness, taking 2 minutes to load and freezing the browser is a pretty good indicator of bad Javascript code.
- BrendanEich 11y agoRather blame FF or some add-on, if you have to guess. Mark Dalgleish's bespoke framework is tiny. The images are not, so maybe blame your ISP? Dunno, not guessing, but JS is last on the blame-guess list.
- talmand 11y agoDon't get me wrong. I agree wholeheartedly. I'm just responding to the accusation as if Javascript is the known culprit. In those cases, chances are the code itself is the problem and not the language. I can code a page that will likely hang the browser but that doesn't mean I don't take the responsibility of the code that I wrote.
- wwweston 11y agoAnecdote, but I've got 30 tabs open in Chrome and I'm using a Macbook Pro that's over 7 years old and it loads in less than 3 seconds. Also, I can open it in Lynx. The un-alt'd images mean there's a bit of inaccessible content, but it's actually more or less coherent, which might be useful to those whose machines are struggling with the content or even (potentially) to those rendering opinions on whether the web just sucks.
- frik 11y agoAnecdote, IE11 "Edge"-mode still doesn't support 3D CSS transformations. It's also end of life in Win8. The presentation worked fine in Chrome and Firefox. It only consumes a few MB RAM. But the favicon of his website is missing - that's why it looks like it loads several seconds.
- lol768 11y agoMy issue with it is that I click on the Hacker News link, step through the slides and then want to return back to the hacker news discussion to read the comments. Unfortunately, each slide is treated as a new history item and Firefox only remembers a finite amount of them so I then get stuck on the presentation with no way to get back to the site I was on before. Tempted to just inject this into each page I visit since the feature annoys me so much: history.pushState = function (){};
- tracker1 11y agoSo, if you're on a search results page, and click next 20 times and then click back, do you expect to go back to the search form, or the previous results page?
- lol768 11y agoWhilst I agree it'd make sense in that particular context for the back button to take me back a page in the results list, I'd rather the search results page made use of actual links which I can use via my browser to make a new HTTP request for another page of results. I dislike sites which insist on loading primary content with JavaScript, breaking the browser's loading feedback (animated icon, hidden favicon) in the process. These sites usually don't handle failed requests properly, either. If I were to post a form in Firefox to a site which happened to be temporarily down, Firefox would display a message explaining what went wrong and giving me the option to resubmit the entire form as many times as I want. I also worry about the pushState function being misused to hide URLs in XSS attacks which involve query string parameters. It's clear you can also stop a user from going back from your page too, something I imagine could also be misused.
- conradfr 11y agoThis page loaded fine for me but anecdotally my FF freeze-on-a-page-load has been as it worse for the last one or two versions (no new extensions).
- TazeTSchnitzel 11y agoIt loaded instantly for me. Do you have troublesome browser extensions?
- M8 11y agoI just wish the best language would win, not the accidentally ubiquitous one. And giving a real choice of language would been even better.
- untog 11y agoBut there is no "best language", that's the problem. Compiling down to JS/asm.js is about as good as we'll get, realistically.
- collyw 11y agoJavaScript is further from an ideal language than many out there.
- untog 11y agoIt isn't, because there is no ideal language. Seriously. Even if there was the goalposts would keep moving anyway as things like functional programming get more popular. My ideal language is one that I can use as often as possible in as many different contexts as possible. JavaScript is alright for that.
- maxlybbert 11y ago> It isn't, because there is no ideal language. There are certainly really bad languages (say, brainfuck). Once you admit that some languages are worse than others, you admit that there can be a hierachy. Of course, it's possible for the hierarchy to have a 256-way tie for first place.
- nemo1618 11y agoI think the ideal would be closer to the asm.js side of things than the JS side. It's nice that I can inspect the source of any page and read high-level code, but the tradeoffs aren't worth it anymore. I'd much rather have a generic (and FAST!) low-level language with lots of compilers from/to high-level languages. We sort-of have that today, with languages that compile to JS, but the reality is that 90% of the time you're going to be writing JS, or at least dealing with it. And personally I'd like to avoid that as much as possible.
- vxNsr 11y agoNice presentation but some of those slides are useless without notes or audio to explain what's going on. I like looking at code snippets as much as the next guy but without context I'd much rather admire my own code.
- codewithcheese 11y agoI have learnt that if I click a javascript post and see a title and author slash screen and nothing else apparently I must start using my right arrow button.
- jasonkostempski 11y agoI only figured this out because about a year ago I ran into a similar issue and poked around the source for 10 minutes to figure out what was going on. This time only took me 1 minute :) Of course, just like last time, after I realized it was another useless slide deck with no context I left the page.
- Tenoke 11y agoThanks, I genuinely couldn't figure out how to see more than the title before I read your comment.
- Semiapies 11y agoAnd that it's fucked on mobile.
- doodpants 11y agoThe first thing I tried was hitting the down arrow key to scroll. The second thing I tried was clicking the blue text, which brought me to Brendan Eich's Twitter page. And then Twitter did what Twitter does, and popped up a sign up/log in dialog in front of the content so I can't actually read any of it. Pressing the right arrow key was my third guess.
- snarfy 11y ago
- cageface 11y agoThis is the first time a webpage has ever triggered a reboot on my iPad. Ironic.
- arenaninja 11y agoSo good to see String.prototype.startsWith and String.prototype.endsWith in ES6. I've ended up implementing these in too many projects. I look forward to using these in 2020 or 5 years after that, when IE 8 finally sunsets. (I joke of course, since you can use ES6 to 5 with IE 8 caveats with the modern taskrunners). EDIT: Blockscope... what? More than a few of these changes point to JS being a functional version of PHP, but doesn't blockscope just fundamentally change the language?
- atonse 11y agoNo, because you have to use the new 'let' keyword to get block scoping. So you have to opt-in to it.
- albemuth 11y agoIt's just for "let" AFAICT.
- BrendanEich 11y agoOnly for let, const, class, and function in block. Like the slide says!
- teacup50 11y ago"Always bet on JS" is complete nonsense: http://brendaneich.github.io/ModernWeb.tw-2015/#74 http://brendaneich.github.io/ModernWeb.tw-2015/#74 It does those things poorly, and at great expense. Eich did one thing, in 10 days, that was market positioned such that it became ubiquitous, and he's been banging that drum ever since -- to everyone's detriment, given how much power over technical direction he wielded at Mozilla, and how much impact Mozilla had on the web pre-Chrome.
- pcwalton 11y ago"Always bet on JS" is short for "There have been dozens of challengers to JavaScript over the last 20 years, and they have all failed to gain traction". What part of that statement is incorrect?
- teacup50 11y agoThat's not what he's actually saying there; that's a list of technical bullet points, not market adoption. However, even if we talk about market adoption; how is Firefox OS holding up against iOS, Android, and Windows? > What part of that statement is incorrect? "Always bet on JS" from Brendan Eich really meant, for 16 years, starting in 1998 and during the time that Firefox was most influential over the future of the web: "I'm never going to bet on anything other than JS". It's a uselessly self-fulfilling declaration when its stated by a (now former) browser vendor executive.
- pcwalton 11y ago> That's not what he's actually saying there; that's a list of technical bullet points, not market adoption. The point is that if JS couldn't do these things, it would be eclipsed by a competitor. It instead grew the ability to do those things, and its competitors never gained widespread adoption. > However, even if we talk about market adoption; how is Firefox OS holding up against iOS, Android, and Windows? In terms of languages on the Web, JavaScript has always won. It's clear at this point that the Web isn't going anywhere, even though mobile apps are important.
- bitL 11y agoI wish JavaScript "committed a teenager suicide" and we finally got a more sane language for the web. It's startling how much energy is spent to work around its bad design every day and it's not getting any better, people are just getting used to it (which is akin to voluntarily agree with having most of one's brain blown off). Even seeing Brendan showing off that he hacked the language in 10 days makes me sick to the stomach...
- aikah 11y ago> I wish JavaScript "committed a teenager suicide" and we finally got a more sane language for the web. While javascript has obvious flaws, nobody would ever agree on what a sane language would be. I would also say that, personally, I think that how the DOM is implemented is itself the biggest pain point of web development, not really javascript.
- vezzy-fnord 11y agoLua is a sane ECMAScript in many ways.
- robocat 11y agoExcept that Lua and the Lua libraries are not strictly defined. Lua would be a fine choice if we were all to use for example only Microsoft Lua ;-) Seriously, there have been a large number of compatible ECMAScript implementations, which still astounds me because that is no easy feat.
- gravity13 11y agoWhy DOM? It seems pretty simple to me, a simple standardized tree of nodes representing content. My biggest gripe would actually be CSS. I mean, wtf.
- macspoofing 11y ago>I wish JavaScript "committed a teenager suicide" and we finally got a more sane language for the web You got it. ES6, ES7 are making JS look better and better.
- deleted 11y ago[deleted]
- Torgo 11y agoI find it very interesting that he says asm.js was "discovered" rather than "invented". Clues to a person's philosophy.
- ravishi 11y agoI read that as a joke. Wasn't it?
- azakai 11y agoI think that's similar to how people say JSON was discovered by Crockford. Both only use things already present in the language, but they do form something new out of them. It is sort of a middle ground between discovery and invention.
- TazeTSchnitzel 11y agoMoreover, 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.
- Torgo 11y agoIs 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.
- azakai 11y agoModern 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 http://kripken.github.io/mloc_emscripten_talk/sotu.html#/16
- azakai 11y agoYes, correct. Emscripten and mandreel already produced something quite like asm.js, before asm.js was defined.
- sker 11y agoI never understood why HN likes slideshows so much. Am I the only one who finds them completely, 100% useless without the audio of the presentation?
- geoelectric 11y agoDepends. Sometimes people write slideshows for internet sharing, in which case they're crappy presentations but text-heavy enough to be effective. Netflix's classic "Culture Deck" is a decent example there. But the ones that are good for presentations--that is to say, visual interest hooks, not the info being repeated--yeah, not great unless they include an audio track or something. Edit: this one's somewhere in the middle.
- brlewis 11y agoThis one was maybe 15% useless. Most slides made sense without the audio. Slide-size chunks of information can be a really good format.
- s_dev 11y agoDepends on the slides really - you're right though some of them need their context to be meaningful. Doesn't have to be audio a scrollable transcript could suffice.
- bshimmin 11y agoYou really aren't. I have never made it through more than about 10 or 15 slides in a deck, and this was no exception. The text version of a talk, however, can be a wondrous thing, and here's a great example: http://idlewords.com/bt14.htm http://idlewords.com/bt14.htm
- gweinberg 11y agoI agree. Transcript without the slides, almost as good as both. Just slides withouyt transcript or audio, shit sandwich.
- wil421 11y agoI didnt even realize it was a slideshow. No arrows or icons you can click to go to the next/previous slide and nothing on the website saying its a slideshow. Thanks for your comment. After I read it I went back and clicked an arrow key and the cubeshow started.
- mitchi 11y agoIf you haven't seen a Brendan presentation, they are quite enjoyable. Last time he was playing some zombie video game in the middle of his presentation. He insisted on not killing zombies with a shovel using instead deployable automatic turrets. I'm sure he uses the shovel when he plays alone though. Javascript's is actually growing very well and fast. It's quite surprising how soon it will have everything. In a way it can be compared to PHP - soon it will be a giant toolbox. The difference is that every tool was chosen and added one at a time. It ends up being a very good toolbox. I'm sure productive programmers aren't complaining. Pure FP programmers can always compile their ClojureScript to Javascript. For me, ES7 Javascript is already making me happy.
- deleted 11y ago[deleted]
- tracker1 11y agoHonestly, I love JS... ES7's async/await is really nice too. But I wouldn't compare it to PHP (which I personally dislike) at all.
- BrendanEich 11y agoAutomatic sentry-chicken turrets. http://beta.unity3d.com/jonas/DT2/ http://beta.unity3d.com/jonas/DT2/
- pyed 11y agothis page crushes my iPhone's Safari, Am I the only one ?
- Rainymood 11y agoInteresting, really interesting stuff, but for the love of god - PLEASE - just me use my mouse and scroll! (!!)
- theandrewbailey 11y agoIronically, if you turn off javascript, you can scroll right on through.
- CrystalGamma 11y agoSo that's why I didn't notice any of that ...
- peter303 11y agoWhy did they ever have to confuse the named with the Java programming language? They are quite different. https://www.w3.org/community/webed/wiki/A_Short_History_of_JavaScript https://www.w3.org/community/webed/wiki/A_Short_History_of_J...
- tedunangst 11y agoRead your own link? "This was somewhat of a marketing move at the time, with Java being very popular around then."
- tambourine_man 11y agoI'm really curious to read this, but after crashing mobile safari more than 20 times, I've given up. Edit: It seems to be Safari's fault, as Chrome handled it nicely.
- vbezhenar 11y agoI wonder whether `let` should be used everywhere now making `var` effectively obsolete? Mixing both declaration styles looks bad.
- svachalek 11y agoAs I understand it, yes, 'var' is now obsolete. 'let' does the same thing with less confusing semantics.
- e12e 11y agoSo, 20+ years ago, javascript was a scheme(-like langauge) -- but was disguised as java for marketing -- now we can go back to a more scheme-like javascript? I wonder if we'd be better off with a proper scheme in the browser in the first place...
- albemuth 11y agoClojureScript is pretty cool!
- Touche 11y agoI disagree, function scope is not going away. So I still have to understand that. If I mix in lexical scope, I now have to think about 2 scopes, which makes my life worse.
- pfooti 11y agoI think one could argue that function scoping is no longer necessary - there's nothing you would do with function scoping that you couldn't do with lexical-block scoping, since with lexical scoping, you can still declare variables at a function block scope. The only real benefit I can think of from function scoping is hoisting, reliance upon which strikes me as an antipattern.
- gtirloni 11y agoI'm not a JS programmer so I was confused with using "let" and the arrow function to create a function versus using "function funcname {}".
- knightofmars 11y ago"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 something. I've worked with enough engineers that love to criticize every design choice made but when it comes to asking them what the better alternative is they have nothing to say. They just "know" there's a better way. Well, stop using your intuition based rationalizing that there's a problem and start using your creative and logical faculties to actually solve the "perceived" problem before presenting a criticism. Or at a minimum present a well thought out and actionable direction towards the solution.
- deezenuts 11y agook
- knightofmars 11y agoI would +1 your username if that were a feature of YC.
- teacup50 11y agoThere are no end of alternatives out there today, from mobile platforms to research languages exploring a myriad of aspects of computer science. Just let me know when browser vendors are going to break down the two-tiered system, and let us run the legion of alternatives alongside -- instead of under -- JavaScript. Or, they could take their own medicine, and try and write the browser in JS.
- pcwalton 11y ago> Just let me know when browser vendors are going to break down the two-tiered system, and let us run those myriad of alternatives alongside -- instead of under -- JavaScript. The complexity of doing that would be needlessly high compared to just improving JavaScript. Having to integrate a C++ DOM with a JS DOM is hard enough. Think about how you handle cross-language cycles… > Or, they could take their own medicine, and try and write the browser in JS. You mean like Firefox?
- eliotfowler 11y agoEich states that in the original implementation of JS, Array was just Object with a length property. How did it handle order?
- serve_yay 11y agoIn JS, arrays are just objects where the indices are keys. There is a small bit of magic where any time you alter an array object, the length is changed to the largest numeric key the object has, plus 1.
- willvarfar 11y agoobject[0] is object["0"]
- TazeTSchnitzel 11y agoThe order is just the number in the key. So the "0" item is the first, "1" is the second, etc. As it's just an object you can stick non-sequential-positive-integer keys on it, but that rather defeats the purpose.
- outworlder 11y agoOh 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.
- TazeTSchnitzel 11y ago> But could you please fix the damn boolean logic? Last time I checked, !, && and || worked like they do in every other language. > And while at it, get rid of most implicit conversions. If you get rid of them JS ceases to be JS because all JS code ever written stops working, rendering the language about as useful as something I suddenly decide to create myself in 10 days. Use TypeScript or similar if the implicit conversions bother you. You don't need to write JS directly. > 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. This was mentioned in the slides. Did you read them?
- cozuya 11y agoDeprecating == is probably a good step. Or better yet just turning == into === and removing that. That would cause some chaos thats for sure...
- UnoriginalGuy 11y agoThey 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.
- sjrd 11y agoIt seems "use strong" is for you. https://developers.google.com/v8/experiments https://developers.google.com/v8/experiments
- izolate 11y agoJavaScript is like English. It incorporates the best parts of other languages. Starting from Java, you can now see the clear influence of Python in ES6/7 with generators and string templates. I think this is JS's greatest asset.
- TazeTSchnitzel 11y agoI wouldn't say English "incorporates the best parts of other languages", but you're on the right path. Like English, JavaScript's ubiquity has lead to it being elaborated such that it is suitable for a very wide range of use cases. Like English, JavaScript's ubiquity has made the language grow considerably, but it has made the language more flexible at the same time.
- debacle 11y ago> Python in ES6/7 with generators and string templates. When I think of generators and string templates, Python is not one of the first three languages I think of.
- stusmall 11y ago"We don’t just borrow words; on occasion, English has pursued other languages down alleyways to beat them unconscious and rifle their pockets for new vocabulary." --James D. Nicoll
- M8 11y agoLike a ball of greasy dirt rolling through a jewelry market. Is the end result beautiful or just the individual features?
- je42 11y agodon't forget the destructor pattern.
- blakecaldwell 11y agoTook me a moment to realize I had to use arrows. I tried scrolling, and figured maybe the JS on the page was busted.
- BurningFrog 11y ago"Date hand-ported (h/t ksmith@netscape.com) from java.util.Date" I knew it!! The Date class is/was the worst thing about the Java library. It has confused a generation of programmers about dates and time zones. The main problem is that it's not a date, it's a time stamp.
- TazeTSchnitzel 11y agoMath was mostly copied from Java too.
- deleted 11y ago[deleted]
- TazeTSchnitzel 11y ago> In Java you legitimately have alternatives, since the alternatives can make the same raw OS calls that the java.util.Date library does. Not so in JS. So instead we HAVE to work with Date and work around its many warts. Uh, what? Yes, JavaScript's Date is the only way to get at that browser/OS stuff. So an alternative will use Date underneath to obtain that information. That doesn't mean the end-user has to work with Date.
- tracker1 11y agoI'll add that timezone information shifts politically over time... It'll never be consistent... your best bet is to ship all dates in UTC as much as possible (which `.toJSON` does) and display in local (which `new Date(jsonstr)` does). Dates are evil, even in C# with offsets it's not easy... and that's probably the best implementation of dates, with consistent updates I've seen.
- TazeTSchnitzel 11y ago> your best bet is to ship all dates in UTC as much as possible (which `.toJSON` does) and display in local (which `new Date(jsonstr)` does). Goodness yes, I really wish more sites did this. If you're asking a user what their timezone is, you're usually doing it wrong. Send UTC to the client, gracefully upgrade with JS to local time. This also solves those pesky DD/MM/YY vs MM/DD/YY issues!
- LittleDan 11y agoFor background on the user-defined operators and literals idea for ES7, see this: http://www.slideshare.net/BrendanEich/value-objects http://www.slideshare.net/BrendanEich/value-objects (it took me a little while to find; it hasn't been as prominent in recent discussions as the other items). I'm excited to see all the progress Javascript is making!
- jessaustin 11y agoSort of off-topic, but I have to observe that slides 58 and 59 are the clearest, most succinct description of how classes and prototypes are related that I've seen.
- wppick 11y agoCan someone explain the isNaN part of this slide: http://brendaneich.github.io/ModernWeb.tw-2015/#46 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?
- TazeTSchnitzel 11y agoI think I can. The old isNaN() coerces to Number, and non-numeric strings become NaN in JS, e.g. +"LOL" is NaN. However, the new isNaN() just returns false if the value passed isn't of the type Number, which I guess might be useful if you're going to use isNaN() on non-Number values? Before someone says that NaN means "not a number", technically yes it does, but it is really just a special value of the Number type. Edit: Oh, zastavka's comment has enlightened me now. I think the reason they changed it is because now it'll check if it's NaN (return true) or anything else (return false), so it'd be like === NaN if you were able to do that. Previously it'd check if it coerces to NaN. I guess the new behaviour is more intuitive.
- magicalist 11y agonote that isNaN() will remain as it is today, coercing to a number (and so isNaN('LOL') will continue to return true). Number.isNaN() will have the new behavior, testing for actual IEEE 754 NaN values (and so returning false for Number.isNaN('LOL')). Such is the unfortunate price of backwards compatibility.
- nemo1618 11y agoprobably 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.
- robocat 11y agoIronically 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 http://en.m.wikipedia.org/wiki/NaN
- frik 11y agoEdit2: When do you switch off your transpiler and serve native ES6? In 2020? Original: What do you do in 2017? What if you already code in ES6 and transpile it to JS5 at the moment. Do you simply switch from serving JS5 to JS6? Older browsers (todays current browser) don't support "class", "let" and other new syntax constructs. The just fail with JS errors. Can one browse the web with IE11 and iOS 8 Safari in 2017? (e.g. "lifetime support" of the device) Polyfills can be used for pre-JS5 browsers. But can you polyfill "let" and "class" syntax keyword? One can today still browse the web with IE6 and Phoenix 0.l (early Firefox), despite a few glitches and layout bugs. Many sites use polyfills like JQuery and still use JS3 functionality made popular by Crockford "JavaScript the Good Parts". JS5 added a few things that JQuery made popular. The syntax changes between previous JS versions were smaller in comparison to ES4 and ES6 (ES4/E4X failed and was abandoned). Edit1: I added "What if you already code in ES6 and transpile it to JS5 at the moment." as the second sentence to make it clearer. As several down voters misunderstood my serious question.
- magicalist 11y agoThe web is a lot more broken if you browse in IE6 than you appear to think. Some major sites work OK only because they had a financial interest (single digits of IE6 marketshare) until the last few years to maintain IE6 compatibility. This will degrade rapidly, but go off the very-well beaten path today and you'll find the web basically unusable. Backwards compatibility on the web has long been backwards compatibility of source. Sites written in the IE6 era and not touched since should continue to work in browsers of today (which is why things like vendor-prefixed features proved to be a poor idea and are mostly no longer created). You'll get some rendering oddities, but this is still very much true.
- frik 11y agoIE11 (Win8) and various devices that won't receive an update like many Android 4 and older iOS devices will be around for a few years! Sure, you can use a transpiler and serve JS5 the next ten years (2025). What do you plant to do? It seems most simply haven't thought about the problems lying ahead. Many were against the ES4/E4X changes that e.g. Firefox supported for some time, as they would have broken backwards compatibility. ES6 breaks backwards compatibility with the new syntax keywords and there is no fallback afaik. If there is a fallback, well then everything would be fine. Wouldn't it be better if such vendors would ship an security & ES6 syntax support update to their old browser software?
- iyn 11y agoIf you're interested in learning ES6 basics in 20 minutes, this is a great starting point: https://github.com/lukehoban/es6features https://github.com/lukehoban/es6features Check out this repo, if you have a "little more" free time: https://github.com/ericdouglas/ES6-Learning https://github.com/ericdouglas/ES6-Learning To be honest, I used to dislike JS not so long ago - it was hard to debug, I had to use strange conventions to write OO code etc. But after learning more about the ES6, react/flux, node, Flow etc. I can honestly say that I really, really like JS. I think that I had negative feelings towards JS because I was using it "the old way" and completely ignored the language improvements & community/ecosystem that grew aroud it. But I learned my lesson :).
- stickperson 11y agoWhat other resources did you use? I'm slowly working my way though Programming JavaScript Applications.
- solarexplorer 11y agoI use the (soon to be) language standard as a reference: http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts http://wiki.ecmascript.org/doku.php?id=harmony:specification...
- iyn 11y agoThere is no a single site/book I use, I just search for a topic that I think is interesting. Fore example, lately I've been exploring Promises and asynchronous JS [0][1]. For understanding react & flux, you can watch 3-part series from SeattleJS [2]. This post is a good general roadmap: [3]. [0] https://www.promisejs.org https://www.promisejs.org [1] https://promisesaplus.com/ https://promisesaplus.com/ [2] https://www.youtube.com/watch?v=Pd6Ub7Ju2RM https://www.youtube.com/watch?v=Pd6Ub7Ju2RM [3] https://medium.com/javascript-scene/learn-javascript-b631a4af11f2 https://medium.com/javascript-scene/learn-javascript-b631a4a...
- krat0sprakhar 11y agoLet me just latch on this comment to recommend Nicholas Zakas' book on ES6 - https://leanpub.com/understandinges6/read https://leanpub.com/understandinges6/read Will take you a weekend to read at the max and it's well worth the effort.
- alkonaut 11y agoJust imagine what the web would be today if only 3-4 weeks had been spent designing javascript...
- rwallace 11y agoIntuitively 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.
- manish_gill 11y ago> "Always bet on JS" Yeah, that's why it took you so long to get basic things in the language. The JS crowd is finally excited that they have these nice shiny things. Quite a few of those have been a standard part of numerous languages for so long. "Always bet on JS" basically means this: "JS is too big, so all the fuck ups I and others made will eventually be fixed. Because nobody is going to try to bet on anything other than JS now." It's circular, Eich.
- BrendanEich 11y agoJoke's not funny when you explain it.
- BrendanEich 11y agoOk, I guess I have to explain it. (Kids these days!) I close with a slide containing bullet points rebutting all the dumb things said about how JS-can't-do-X, not to say how great JS is, but to show that software is hackable, and if Java, or Flash, or Dart can do X, so can JS. Evolving JS or doing something else is a matter of choice. JS's priority of place is not, it happened and it makes JS very hard to replace. But not hard to evolve. I use a pic from one of Wesley Snipes's lesser movies, "Passenger 57", where the bad guy gets TOLD in a macho-funny scene on a plane, over an in-plane phone yet: "Always bet on black!" It has a great build-up with camera-work and music to match the delivery. But it doesn't mean anything more or less than always bet on Wesley kicking that pale-eyed, blond-haired villain's ass, because Wesley is a bad-ass and way more fit than Bruce Payne (who played the villain). JS is way more fit than the comers whose fans spewed all those bogus detractions. Deal with it.
- backspaces 11y agoTuring Complete is soooo comfy!
- eldude 11y agoWRT async/await, don't lazily prefer serial await, when parallel await is possible: Serial example: async function someAsync(list) { let ret = []; try { for (let item of list) { let res = await asyncFn(item) ret.push(res) } } catch(e) { /* ignore */ } return ret; } Parallel example: async function someAsync(list) { let promises = []; try { for (let item of list) { let promise = asyncFn(item) promises.push(promise) } return await Promise.all(promises) } catch(e) { /* ignore */ } return []; }
- bla2 11y agoEvery 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.
- brlewis 11y agoI recommend Toastmasters, its Competent Coummunicator program, and the Advanced Communicator manual for Persuasive Speaking.
- Dewie3 11y agoI suspect that it might be simple to make something like JS in 10 days when you can effectively delegate the heavy lifting of making it fast etc. (see last slide) to many other people after it has become ubiquitous. :)
- _yosefk 11y agoI wrote my own interpreters for my own languages, including stuff used in production. 10 days for designing and implementing something like JavaScript is pretty good. Also, I think that the number of problems in JS normalized by the time it took to make the first version (and that time limit was due to a deadline that the creator did not choose) is very likely smaller than in many, many other languages, if not all the remotely popular ones.
- jsnk 11y ago1. I think he mentions it because it is an interesting part of JS's birth. There are some ambiguous things about JS that makes people ask, why is this the way it is? Well, one explanation is that, it wasn't a carefully planned language in its conception. Someone needed some language that worked on top of browsers really soon and Eich had to deliver something. So he must have cut corners and made some difficult pragmatic decisions to just make a language that just works on browser. "I made this in 10 days" goes perfectly with this story Eich wants to tell. It's catchy and understandable. 2. O please. Stop with this arrogance. Even if you didn't mean it, it totally comes off as "JS sucks" comment. JS as a language has a huge value in it being a first mover and generating network effect. Would you rather have that we use Java VM on browsers? Or would you rather have 12 different languages used in differently, implemented differently in 12 different browsers? To make matters worse, would you like browsers to change its languages based on what's considered a flavor of the week?
- sagivo 11y agojavascript is so bad that it's great! i love it and love even more what it becomes lately.
- drawkbox 11y agoInteresting the Date object was a direct port from java.util.Date. It always felt a little out of place in terms of style in early javascript and this is why. ES6 is awesome and there are so many good things happening in it. I was always a little irked that ES4 (ActionScript 3 was built on it) that had some of these elements was nixed for ES5 like typing, extending and cleaner events. Great overview and I picked up a few things I have missed in js advancements like string handling changes (startsWith, endsWith, trim), templating with `, multiline strings!, extend, math functions, arrow, default/rest params, octal/binary literals and tons more. Many of these are probably in everyone's js libs but nice to have them standard. I am most excited for asm.js of all due to the WebGL and gaming/app performance impact that will make when fully integrated in all browsers this year. asm.js and WebGL gaming is already giving benefit to performance in Javscript and added typed arrays to ES6. Also in his 90's TV pic, how could you forget Seinfeld?
- roneesh 11y agoI'm really excited for all these new changes in JS. ES6 and onward is beginning to feel like a whole new language.
- copsarebastards 11y agoJavaScript at 20... apparently doesn't work. I load the page and get a big rectangle that says "JavaScript at 20" and "Brendan Eich" with a link to his Twitter, and nothing I do on the page takes me to the rest of the presentation.
- codewithcheese 11y agoIts insane but press the right arrow button.
- imron 11y agoCame here looking for this. Insane.
- copsarebastards 11y agoThat doesn't work on my personal laptop. Works on my work laptop though.
- tomcam 11y agoPress space or swipe or right arrow
- crobertsbmw 11y agoAll I get is a link to Brendan's twitter account. WTF?
- crobertsbmw 11y agoRight arrow....Dumb.
- mrnaught 11y agoThey said all those things to Java too. And still it is everywhere. So always bet on Java.
- BrendanEich 11y agoBut not on the client side.
- morenoh149 11y agoSo does anyone have a link to "Java Intermediate Bytecode" can't find the paper for free online.
- robert_tweed 11y agoThis page caused my iPad to hard reset. Twice. That's pretty impressive actually, but I don't currently have access to any other computers to read it on, so it's also quite bothersome. Does anyone have an alternative URL with the content, but without the slideshow or whatever it is? I'm presuming it's some JavaScript that is causing the crash. Yes, I appreciate the irony and no, I'm not trolling. I really want to read this!
- pfooti 11y agoThis is a fascinating meta-post. First, it's a slideshow, so there need to be some posts about right arrows and general complaints about scrolling (as if Eich created this content himself to post to HN, instead of to be a speaker aid for himself). Second, it's about Javascript, so a bunch of people who really love lambda syntax and significant whitespace are going to show up and talk about how much better the web would be if we all ran python in the browser. I think the web would be a lot better if we just ran lisp in the browser. Heck, I think lisp is pretty much the answer to all our problems. But nobody ever asked me. As someone who was developing for the web in the (late) 90s, using web browsers and java as a cross-platform UI for educational software (mac and windows!) who tried to get java applets to communicate with each other (possible but difficult, and I ended up running a local java application that the applets RPCd to), I can say this with distinct clarity: the DOM and current (modern ES6) javascript system are pretty great. Sure, they could be better in some ways, but I don't trust Joe Programmer (just for example here) to understand re-entrant code well enough to write stuff that actually works in a multi-threaded environment, so single-thread event-driven is great. People complain about this binding and so forth, but it provides a great borrowing / mixin mechanism to the language that is just flat out impossible in other languages. The prototype inheritance system is funky, but es6 classes mean you don't need to worry about it. If you want to, you can do some pretty rad metaprogramming with it, though. Type coercion is kind of a pain, and frankly I'd love to be able to override operators (writing === semantics for objects over and over is kind of a PITA). But seriously, Javascript is pretty great. I pass around functions, chain together stuff with functional-based approaches (front-to-back no less), and can do all sorts of hip kinds of programming with it. Maybe if we had some truly-different language driving the web, things'd be different, but don't complain about javascript and just put forward python. Put something like haskell or smalltalk on the block. Let's go big with the radical differences. I mean, c-ish languages are c-ish languages. I only wish CSS was as nice as Javascript. If I had my druthers, that's where we'd be focusing; that and namespaces within the DOM (hello, shadow DOM!) Okay, longpost over. And late no less - serves me right for working all day instead of reading HN. Writing JS no less.
- jongdubois 11y agoOverall, JavaScript is a great language. I don't find the prototype-based approach to OOP any less intuitive than the class-based approach. I much prefer it in fact. It just so happens that the prototype approach didn't catch on early enough. Developers are now just really set in their ways and are rather pretend that JavaScript is not a true OO language. I feel that the addition of a 'class' concept to ES6 adds no value to the language itself, but I think it was probably a good decision anyway - Because JavaScript is more flexible and adaptable than the minds of most people - It might as well use that to its advantage. Unlike the stubborn developers who refuse to learn about prototype inheritance, JavaScript is capable of change.
- smrtinsert 11y agoBuilding out a large app in angular lately has reminded with renewed vigor why I hate js.