Slashdot Mirror


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

4 of 195 comments (clear)

  1. Re:Why the hell... by IamTheRealMike · · Score: 4, Informative

    The JVM is very language specific. For example it has op codes for allocating java objects. A truly cross language virtual machine doesn't have anything anywhere near that high level or specific to a particular language.

    Whuuu? The JVM does not have opcodes for allocating "java" objects unless you use a very strange definition of the term - if it worked that way then how could other languages target it? The JVM has opcodes for allocating objects and calling methods on them, including opcodes like invokedynamic that exist purely to support non-Java languages like Javascript, Python, Ruby, etc.

    The JVM has a really large variety of languages that target it. It's impressive. There are static languages like Java, Scala, Kotlin, Ceylon etc, there are dynamic scripting languages like JS (using the new Nashorn engine it's only about 2-3x slower than V8), there are Lisp like languages, there are implementations of Erlang and so on. And thanks to the fairly well specified "least common denominator" type system Java provides, code written in these languages can all interop pretty nicely.

    If you think the JVM is language specific then I'd suggest looking at Ruby and Kotlin, two very different languages that are not much like Java, yet nonetheless both can run on top of the JVM.

  2. Re:Why the hell... by Jeremi · · Score: 4, Informative

    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?

    JavaScript is the 'bytecode' to compile to these days.

    Not saying that's optimal, but if JavaScript is what the world's web browsers run, then JavaScript is what people will target to get onto those web browsers. At least you can still use your language of choice to do so...

    --


    I don't care if it's 90,000 hectares. That lake was not my doing.
  3. Re:Browser Apps are NOT desktop apps by StripedCow · · Score: 4, Informative

    Web-workers are not cutting it. For the following reason.
    Real multi-threaded programs have a shared address space. Web-workers do not.

    Example: suppose your GUI runs on a 1 megabyte long text-file.
    The data-structure that models the text-file is 2 megabytes long.
    Now you want a web-worker to do something with this text-file in the background (e.g., count the number of words).
    So you start a web-worker thread. But then you need to send the text-file as a message to the thread (since there is no other way the thread can reach the data).
    Sending this 2 megabyte chunk of data will surely freeze your GUI for a while, and so the whole point of multiple-threads is mostly lost.

    --
    If Pandora's box is destined to be opened, *I* want to be the one to open it.
  4. about:config, browser.backspace_action=2 by tepples · · Score: 3, Informative

    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.