JavaScript and the Netflix User Interface
CowboyRobot writes Alex Liu is a senior UI engineer at Netflix and part of the core team leading the migration of Netflix.com to Node.js. He has an article at ACM's Queue in which he describes how JavaScript is used at Netflix. "With increasingly more application logic being shifted to the browser, developers have begun to push the boundaries of what JavaScript was originally intended for. Entire desktop applications are now being rebuilt entirely in JavaScript—the Google Docs office suite is one example. Such large applications require creative solutions to manage the complexity of loading the required JavaScript files and their dependencies. The problem can be compounded when introducing multivariate A/B testing, a concept that is at the core of the Netflix DNA. Multivariate testing introduces a number of problems that JavaScript cannot handle using native constructs, one of which is the focus of this article: managing conditional dependencies."
Apparently pushing the boundaries of what DNA can do, too, if they built their company out of it.
..is to not have a backspace ruin everything you just did just because you didn't have the focus you thought you had (Chrome!). And to work offline as good as online. Take email as an example. I really like using travel time to catch up on, reply to and delete email. But often travel time does not have internet access (train, plane). For now, email clients are superior to web email because of this.
to have a movie content company that tries to be geeky. All others are exactly the opposite. Really, its nice to see fresh air mix up the stench.
1) making useable interfaces
2) not treating their employees like shit
It's unfortunate that Javascript has become the embodiment of the Golden Hammer in the programming world. And, just like a hammer made of gold, it doesn't even work that well as a hammer. It is only so widespread because when it comes to the web, it's the only tool you have.
Why the hell are we still stuck using Javascript for the web? Why have we not got some virtual machine (not a language specific one like the JVM), that we can compile any language we like to? Half the world is trying to hack around javascript's shortcomings. If even half that effort was directed at making PNaCl viable on all browsers, we would be so much further forward.
You're serving me content. Not lots of pieces and here, piece'em together yourself.
Doing everything dynamically without dire need was stupid, but at least the server bore the cost. Now it's being pushed off to the browser, and having your visitors foot the bill. When most pages by far would have been better done once, server side, then served up in its entirety as a ready-made page many times to all comers.
I hate it. Makes browser loading/transitions slower than just loading a JVM or Flash(and that's saying a lot), fucks with mobile, fucks with NoScript, screws up common hotkeys like backspace which loses what you've written Google Docs unless you're smart enough to run Lazarus(which you shouldn't have to), etc etc etc. Trying to be slick just makes it worse.
Do your damn application logic on the server, as it is indented to. Everything else is insecure and unreliable. Really, that something is possible to do does not mean it is by any means a good idea.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
I would go so far as to be disappointed by the whole nature of amazon prime, netflix, et al. What could be an utterly federated beast where a unified client experience could present streams straight from disney, viacom, sony, or *whoever* without a middle man, instead we get to suffer the reality that we have noc ontrol over what our subscription fees go to and we have to launch *entirely* differnt user experiences depending on who has the license to certain content this partiuclar moment...
In the 90s, a wonderful thing happened. Completely federated facilities (email, web, newsgroups) beat out the proprietary approaches of the day (AOL, Prodigy, CompuServe). It seems that 'accident' will not be allowed to be repeated and in fact efforts will continue to roll back what federated service goodness we do have (e.g. social networking platforms striving to displace email with something more like the bad old days).
Browsers should not standardize on a particular programming language, but rather on bytecode. But no one wants to use the other's Bytecode solution ( although we have sever great bytecode standards to choose from ) so we're stuck with Javascript.
Ah Javascript. The language we all love to hate, but isn't going anywhere. It seems like a good portion of all development will be Javascript in the not-too-distant future as legions of low paid programmers take up code writing and maintenance.
Lets stop pretending they are anything close.
Google docs/sheets/whatever is a really crappy imitation of a full fledge office suite ... from 15-20 years ago. It doesn't even compare to Office 95 other than it has online sharing and collaboration, which is great, except thats a tiny subset of what its actually used for.
Just because you can make a half assed, no where near feature complete but looks pretty and does the first 3 things that come to mind look-a-like of an desktop app doesn't mean its a desktop replacement.
There are no desktop applications 'written entirely in javascript' unless you redefine what a desktop application is to fit a narrow subset of what everyone else does.
Learn to use the right tool for the job and stop thinking just because you can make something look-a-like and emulate a few basic functions that it is the same thing. A screwdriver can be used as a hammer, but it makes a shitty hammer. Google docs CAN be used in place of a full fledge office suite, but it makes a shitty office suite when you replace one entirely. Most geeks who use 'office suites' don't actually use office suites, they occasionally type a few pages into a word processor, sure but they don't do the same things as your full time paper pusher.
Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
Isn't that more or less the idea behind NaCl/Native Client? It doesn't seem to have caught on. For that matter, there was also ActiveX, and the best that you could say about it is that it had a flawed implementation.
Chrome also just added a runtime for Android apps, which seems to handle at least some simple apps at native speed on my chromebook. I suppose that's a java runtime of some sort?
I know that there are many wonderful things done daily in JS, but I really would prefer another scripting language.
Those who advocate genocide deserve every protection afforded by law, and none afforded by common human decency.
...Congratulations, you have reached the absolute pinnacle of insanity.
*Don't slip and fall!*
And use spaces not tabs.
Man, web apps are so early 2000s. We're all running local apps on tablets and phones now, dudes.
Why the hell are we still stuck using Javascript for the web? Why have we not got some virtual machine...
asm.js is a subset of javascript that is easily translated to low-level instructions... And runs at near native speed in browsers that optimize asm.js. :) In in practice it might not be "backwards compatible" as speed is a feature.
:)
Don't get me wrong, I totally agree that asm.js is a messed up construction... One can think of it as a bytecode encoding in Javascript...
But it works, it's fast, and it's backwards compatible... Though anyone trying to use large asm.js programs in browsers with a poor javascript engine will get an extraordinary poor performance
Anyways, why not? It works
As an old-school back end specialist, I hated the spaghetti runtime error aspect of Javascript -- until I started decoupling various aspects using, for instance, AngularJs. Lack of compile-time checking is an increasing part of even compiled languages like C# (dynamic, reflection), but since AngularJs supplies dependency injection, sanity has returned to the logic that needs to be in the front end. As I've increasingly shifted page loads to Ajax calls, my pages have become sweetly responsive even on slow (mobile) connections, and the turnaround time of a Javascript code change is often simply that of saving a file and refreshing the browser page, compared to starting a new session from scratch on a compiled back end change. It's also no contest on the turnaround of compiled vs Javascript unit tests.
The decoupled nature of AngularJs leads to remarkably few actual moving parts or Hail Mary references ala jQuery. The last logical step is whether or not Ajax calls are to node.js, but since back end Javascript is as testable as anything out there, it comes down to preference and the maturity of the back end framework.
To the credit of Java, it is well designed. It makes it difficult to shoot yourself in the foot, while being a somewhat productive language and libraries. That is great for less skilled coders.
javascript has weird quirks. Not good for less skilled coders. I think the inferiority of javascript will hamper the usurping of Java.
I fully expect it [Javascript] to eclipse every other language in terms of popularity over the next ten years, for exactly the reasons you state. Driving down the cost of labor, and unifying skill sets so that people are even more interchangeable.
It pains me to say this, but Javascript is not that bad... I used to really hate it; but over the last year I've done a lot of node.js development. And if done right, it can be really nice. I usually write classes that takes a JSON object and does something... Then I can be very declarative when I put things together. Also asserts helps :)
But yes, static type safety seems to be underrated these days.
As for driving down cost of quickly writing something, I think that is good... Lots of administrative tasks, etc aren't done electronically because it's too expensive to write a shitty web-application. Don't be afraid for your job, the need for qualified developers won't disappear... Mostly there'll probably just be more tasks that it is feasible to develop (at least that is also a factor).
asm.js already addresses this.
In my copy of Firefox on Xubuntu, backspace does nothing if a text area isn't focused. If I want to go back I can press Alt+Left. When I started typing this post, I didn't know if it's default or if I had previously done what is described on the first result from Google firefox disable backspace. Short answer: put about:config in the location bar, put backspace in the search bar, and change the value of browser.backspace_action to 2 (nothing). Turns out it defaults to 0 (navigate back) on Windows and 2 elsewhere since late 2006.
If you really need client-side processing, do a real piece of software for it.
For which platform shall this "real piece of software" be developed? Windows (desktop), X11/Linux, OS X, Windows Phone, iOS, Android, Windows Store, or something else?
For the few things that need to beat the interaction limit (~200ms)
What about things that don't absolutely need low latency but still need to complete without an explicit form submission and complete page reload, such as autocompletion of search terms or expand/collapse of replies to a post in a threaded discussion board?
a web-application might not be the right choice in the first place. [...] Unless you want to start coding for a specific browser in a specific version running on a specific platform?
A not-web application needs to be coded for an even more specific platform than a web application. Make it for Mac, for example, and you exclude users of Windows desktop, X11/Linux, Windows Phone, Windows RT, iOS, and Android.
Oh, wait. I'm trapped seven years in the past.
JavaScript is wicked fast, has first class treatment of functions, JSON and the object model are beautiful, and its duck-typing supports great mixins patterns. JavaScript is now outside the browser with Node.js. The Node people made some awesome wise design decisions and Node is awesome. In spite of stupid haters, JavaScript just keeps getting bigger and bigger and racking up more successes. It beat Applets, Flash, VBScript, and challengers not worth mentioning to dominate the web. And it is not only on the server now but is showing itself to be in many ways better than other server side languages such as Ruby, Python, and Java. JavaScript is probably the number one language that old code is being refactored into and this isn't just because browsers support it. Other languages can compile to JavaScript, but no one cares because JavaScript is just that awesome. If there is one language that is exciting to follow these days, it is JavaScript.
BUT TEH === ! IT SUX!!
Democracy Now! - your daily, uncensored, corporate-free
Because the Java applet plugin was an unqualified success, right?
That is why hipsters love it as a bad ass Rockstar technology.
http://m.youtube.com/watch?v=b...
http://saveie6.com/
It is a badass Rockstar technology
http://saveie6.com/
...
We have a crap-ton of javascript files we want the client to load, and the client only needs some third of what is available.
Solution: Decide what the user needs at the server side, and send it to them as one big javascript file. ... Like... duh. Should I have patented that idea when I did it 15 years ago?
May I present: http://apps.pixlr.com/editor/
No I'm not affiliated with these folks. Just demonstrating what can be done with modern coding for a web browser. The fact that it's fast, very functionality and probably equals the level of say GIMP or Paint .NET but in a browser, kinda shows what can be done with web development.
All this talk of cool technology and they still can't make a filterable search. Their UI/UX design is horrible.
How about netflix fix their user interface and give users the option to sort their tv/movie list the way they want but instead I have to rely on the Netflix Queue Sort script. Google blocks this script after closing and re-opening the chrome. Firefox too damn slow to use with flash player installed. Yes, all interpretive languages are slow including javascript.
Ah Javascript...legions of low paid programmers take up code writing and maintenance.
Isn't that the real objective behind Hour of Code type of industry initiatives?