Live data from Hacker News

JavaScript at 20

brendaneich.github.io

261–270 of 327 posts

Re: JavaScript at 20

#261
This 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.

Re: JavaScript at 20

#262

> "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…

Joke's not funny when you explain it.

Re: JavaScript at 20

#263
post #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…

I was not good at selling my work in the 90s, and JS almost died as a statusbar-spamming popup-generating toy.

JS succeeded in spite of all my "salesmanship", because it was fitter in its basics and of course its place of priority.

Re: JavaScript at 20

#264
post #25

If 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…

Automatic sentry-chicken turrets.

http://beta.unity3d.com/jonas/DT2/

Re: JavaScript at 20

#265

Earlier quoted context omitted.

Semi-serious question: Other than backwards compatibility, do browsers need to have a DOM? It seems like many web app devs spend more time fighting against the DOM than working with it. Why not just make the browser expose a generic GUI model? Let web devs interact with Webkit or QT directly?

Generic GUI toolkits are very often worse than the DOM. I've worked with Swing, MFC, SWT, Android, and iOS, and all of them are significantly more complicated than the DOM is. They do function at a higher level of abstraction, and the two really nice things they give you are components and a sane layout system (solved by WebComponents and Flexbox, now if only all the major browser vendors would just adopt WebComponen…

I've found JavaFX's scenegraph approach rather neat. Effectively it borrows from HTML, but where the basic node set is designed to be UI elements rather than co-opting a set that was designed for text documents. It seems to take a surprisingly small amount of code to sketch up an interface.

React's not bad on the web side (especially with Scala.js) but fudging around layouts in components with divs and Bootstrap still feels clunky.

Re: JavaScript at 20

#266

> "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…

Joke's not funny when you explain it.

Ok, 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.

Re: JavaScript at 20

#267
post #110
post #56

Earlier quoted context omitted.

I struggle with a couple different tools that were developed in weeks or a couple months or on a plane ride. Every time these guys brag about how quickly they put together the first version I just want to say to them, "yeah, we can all tell. And every day we suffer for it."

Yes. There's just no substitute for time. It's impressive to see something put together quickly, but the result is inevitably lacking in some (or more) ways. In this talk, I couldn't decide whether his saying JS was written in ten days was a rueful admission that it's only natural for it to be a huge pile of shit, or some self-aggrandizement based on how quickly he managed to write it. I always found JS rather tastel…

Hume's Guillotine slices again! Please think through this keynote at a conference. I was asked to talk about the early days of JS. Why do you suppose that I am aggrandizing by describing "is" (or "was") as if "ought" can be derived in a moral sense?

JS happened, I made it in ten days because it wouldn't have happened otherwise. Had I thought it through, I might have insisted on more time -- but then: VBScript.

We don't get to call these shots. Taste and morality have little to do with their hitting targets (whether the ones we aimed at, or others). All the good stuff in JS came from giants on whose shoulders or heads I stood.

I'm not a nihilist or materialist, but I have to laugh after 20 years. JS was not planned out this far in advance!

Anyhoo, my sense of self does not depend on ten days in May 1995. My work on the Web, not just JS but especially on Mozilla, Firefox, and HTML5, doesn't need aggrandizement. My best work has yet to be seen. I'm not doing these talks to boast. Peace.

Re: JavaScript at 20

#268
post #110

Earlier quoted context omitted.

Yes. There's just no substitute for time. It's impressive to see something put together quickly, but the result is inevitably lacking in some (or more) ways. In this talk, I couldn't decide whether his saying JS was written in ten days was a rueful admission that it's only natural for it to be a huge pile of shit, or some self-aggrandizement based on how quickly he managed to write it. I always found JS rather tastel…

Hume's Guillotine slices again! Please think through this keynote at a conference. I was asked to talk about the early days of JS. Why do you suppose that I am aggrandizing by describing "is" (or "was") as if "ought" can be derived in a moral sense? JS happened, I made it in ten days because it wouldn't have happened otherwise. Had I thought it through, I might have insisted on more time -- but then: VBScript. We don…

Just ignore the trolls, most of these naysayers have never implemented a new programming language in their life, but they feel entitled to talk about taste and morality.

Re: JavaScript at 20

#269
post #83

Earlier quoted context omitted.

In fairness, taking 2 minutes to load and freezing the browser is a pretty darned good summary of Javascript at 20.

In fairness, taking 2 minutes to load and freezing the browser is a pretty good indicator of bad Javascript code.

Rather 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.

Re: JavaScript at 20

#270

Earlier quoted context omitted.

Man, python on the server and in the browser. What a world that would be.

> Man, python on the server and in the browser. What a world that would be. If you're going to imagine that as a utopian alternative to JS, be sure to be thorough about it and imagine 1995 Python dominating the browser landscape for years and then the advancement path the language has taken on the server playing out among several browsers. Then come back and tell everybody how much prettier it looks than JS (for bonu…

> The differences between these languages aren't that big and they're largely aesthetic.

They are pretty big. At work I work on a Django-backed project that has a very fat JavaScript front-end client, and JavaScript is incredibly painful to work with compared to Python.

It's not merely aesthetics, but JavaScript in the browser is severely lacking in language features that allow it to scale to larger code-bases.

Post reply on HN