News for hackers. Stuff that matters.
Re:Creating a Virtual Printer Using Node.js [video] by tracker1 on Tuesday December 22, 2015 @03:16PM (#10780103)
The syntax could be a lot cleaner... the Universal Module Definition (UMD) pattern at the top makes it a bit quirky... A lot of people have moved towards using CommonJS (cjs/node-style) exports with tooling such as browserift/webpack and/or babel (for es6 modules) in order to clean up the source syntax.

What you're looking at is a relatively poor example. In es6, that could be ...

    exports default function...
without all the cruft around it, also the module itself could be cleaner. Similar to:

    var cookies = parse();

    export function set({key, value, days=null}) {
      ...
    }

    export function get(key) {
      ...
    }

    export const remove = (key) => set({key, value:null});

    export function parse(values = document && document.cookie || '') {
       ...
    }
Re:Creating a Virtual Printer Using Node.js [video] by monk_e_boy on Tuesday December 22, 2015 @06:00PM (#10780949)
Classes and modules in almost any other modern language are much easier to read and write. Ruby, python, heck even php are better than JS. That's my real issue with JS. If we had a browser that had lots of languages baked into it, none of use would choose to use JS ;) node.js would never have been invented...