Skip to content

Instantly share code, notes, and snippets.

View chadfurman's full-sized avatar

Chad Furman chadfurman

View GitHub Profile

Speaker Introduction Part 1

  • @getify -- Kyle Simpson -- Teaches JS professionally
    • 50-75% traveling and teaching, rest of time “community building” -- open source / speaking / meet-ups
  • LABjs -- dynamic script loader, 5-years old -- fast, ensure order for dependencies
    • Concatenate everything, why script loader? Seeing a switch to HTTP2. Why is this important? HTTP2 changes the way we optimize page load -- persistent socket protocol. Parallel downlaoding.
  • “Grips” -- templating engine.
    • There are “logicless” templating engines like mustache. Requires a brittle connection between backend and frontend. Lots of data massaging.
    • Alternative -- whole programming language embedded into template. I.E. PHP, Dust, Handlebars. Causes mess of business logic leaked into template due to business pressure.
    • “Grips” is an oppinionated templating engine
@chadfurman
chadfurman / p
Created January 22, 2017 03:55
p
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC+nfuAiyRnys5Yphfc8ghmtTCMD8caFn1X8vnS+HbtXLRlfB9twEjFe1WBGf7pafueO5OZN14cLyuHvauC/AXA9jX7HVhEGOTh3eQZHhZLSIUqv0qFiNiPAi6ahpCjITWnpiCNMbDkM6w5oquLw7qiF5Vg5RQWFVdm69f8yoBzmgtWMgMNa1QMQzDbz7zpLCiF451dJnfrKrGTzbKqnrGkgyJ1bkItXMKfrn7rB6MgOd6R49W/rn8w0UzbVkhphHI4GkEF89VuUe5H9EcHN4gEqzNlsduo13SrsqdKf8cMJ2qNb3rLO2INp+AvO6+Z4PytO/jY5I+c2e34API52ad0kkcB/PigGkgAIIRADaHgr0fzvRw4N7TbeIXzwBDKPplFlruSu9jC5fKwrgLF0tEx1l8A20qr9wceXpArFzmiGtYIdo3rYthKKuz6MMqa+IiZVvfO5BTmJaTDHykCTflOQK9WZgRBQjCnzB/c6JQFEEAvhnIUI7ebH0GPFOM/q2Rv3KmnJXax7sT8C3RCy6CLJ4I7LC5fsstgHX5UIP/Y1zcGFsOs4SMomr7WQO6X04ilXKHVv/9k6TWm4OVFpQ6ZAemxmCUkxPqgOSg0gexiC2T+DNRjp8pg3CAdacjH7Xt9VPJ6YIIszcoTJmN+FbnkP7X4zX/CRf8wWDcPJjbfgQ== lotus@Infinity
@chadfurman
chadfurman / hour2.md
Last active January 24, 2017 04:22
hour2

Scope and Execution Review:

var foo = "bar"; // LHS foo, RHS "bar", foo global scope

function bar() { // remember bar is a declaration in global scope
  var foo = "baz"; // LHS foo, RHS "baz", foo local to bar()
  
  function baz(foo) { // remember `foo` is declared here as local to baz
 foo = "bam";
@chadfurman
chadfurman / notes2.md
Created January 24, 2017 13:55
meeting notes 2

Meeting Notes:

  • Discussed reviewing meeting notes at the end -- divide and conqueror? Putting together a nice writeup for each day?
  • Talked about note writing techniques
  • let hijacks block-scope -- differences between let and var is "block scope" and "hoisting"
  • let is cool, has some advantages, but is it really useful? Garbage collector? Security? "Hoisting" is important!
  • let-blocks are cool. Too bad they're not actually in JS. let-er is cool, but try/catch work-around is lame.
  • let is cool, but must be used with caution
  • Does let actually increase performance? let might be a bit more performant, due to stricter scope and better garbage collecting
  • Mozilla suggests "use let" with transpilers, even though let isn't supported yet.
  • let "is" hoisted? Just hoisted with a different value -- "undeclared" rather than the value you give it.
@chadfurman
chadfurman / h3.md
Last active January 31, 2017 04:12
Hour3

Dynamic Scope

Theoretical -- not used in JS

function foo() {
  console.log(bar); // bar is defined in baz, foo was called from baz, so bar is defined
}

function baz() {
  var bar = "bar"; // this is defined in foo because of the callstack
  foo();
@chadfurman
chadfurman / h4.md
Last active January 31, 2017 13:43
hour4

The new keyword

When we put the new keyword infront of any funciton call, it turns the function call into a constructor call This isn't the same as a class There are 4 things that happen when a new keyword is put infront of a function call:

  1. An empty object is created
  2. The empty object gets linked to a different object
  3. empty object gets bound as this for the purpose of the function call
  4. if the function does not otherwise return anything, new will insert return this
@chadfurman
chadfurman / notes4.md
Created January 31, 2017 13:44
Meeting Notes 4

Meeting notes

  • Module pattern is very common. Old way of wrapping with a function, new way of export/import
  • Module pattern is something many frameworks have been using for a long time.
  • A really useful pattern since in JS we don't have access modifiers
  • What about module ___ from 'module' ? I think it's actually import * as module from 'module'
  • What about multiple exports in a single file? I think this is legal
  • this keyword -- the four rules.
    • new keyword
    • explicit
  • implicit
@chadfurman
chadfurman / asdf
Created February 3, 2017 07:05
asdf
asdf

Prototypes

  • object oriented JS has lots of complexity -- going to try to simplify common OO patterns prototypes "Inheritance" vs "behavior delegation" "There are no Classes in JS" -- we need a different syntax & design pattern for our software "OO vs OLOO"?
var Router = function() {
  // Singleton!
@chadfurman
chadfurman / Notes5.md
Created February 3, 2017 13:10
Notes5

Prototypes

  • Prototype Links [[Prototype]]
  • proto vs .prototype
  • this being super unicorn magic
  • Singleton, Observer patterns? Anyone use?
  • It'll be good to squish our notes together into pages
  • Likewise, it will also be good to add some questions to Aurelian's tool