Skip to content

Instantly share code, notes, and snippets.

@clumma
Last active February 26, 2017 04:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clumma/ab7365ef9c4c2bda8114 to your computer and use it in GitHub Desktop.
Save clumma/ab7365ef9c4c2bda8114 to your computer and use it in GitHub Desktop.
JavaScript: The Better Parts

Douglas Crockford
"The Better Parts" (2014)
https://vimeo.com/97419177
https://www.youtube.com/watch?v=bo36MrBfTk4

ES6 Good Parts

  1. Proper tail calls
  2. Splat operator (rest and spread)
  3. Modules
  4. Let keyword / block scope
  5. ?

ES6 Bad Parts

  1. Classes
  2. ?

ES5 Revelations

  • stopped using loops
    array.forEach and array.map instead of for
    Object.keys instead of for...in
    ES6: recursion instead of while

  • stopped using Object.create()
    stopped using the "this" keyword

function constructor(specObj) {
  var that = other_constructor(specObj),
      member,
      method = function() {
        // specObj, member, method
      };
  that.publicMethod = method;
  return that;
}

Next Language

  • An applications language
  • No bad parts
  • Decimal floating point
  • Actor model instead of objects?
    Maybe not. One more OO language first.
  • Prototypal > classical
    No premature taxonomy creation
  • Class-free > prototypal
    Pros of prototypes: memory conservation (irrelevant today)
    Cons: Retroactive heredity (change an object after it's created)
@logicmason
Copy link

Here's the number type he proposes: http://dec64.com/

@clumma
Copy link
Author

clumma commented Oct 27, 2014

The DEC64 proposal has been harshly criticized on Hacker News. Crockford dismisses these criticisms without addressing them directly. I haven't looked at it closely but my perspective is: anything less than a real numeric tower is a joke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment