web directions code 13 notes
DESCRIPTION
Given at wdc 13. This is to shut brian up.TRANSCRIPT
See the tries for the trees
http://www.flickr.com/photos/zoer/2363020211/
Tuesday, 7 May 13
3Tuesday, 7 May 13
Tuesday, 7 May 13
Add fast moving imagesTuesday, 7 May 13
Tuesday, 7 May 13
Halo effect
1861
Tuesday, 7 May 13“A general “law of least effort” applies to cognitive as well as physicalexertion. The law asserts that if there are several ways of achieving thesame goal, people will eventually gravitate to the least demanding courseof action. In the economy of action, effort is a cost, and the acquisition ofskill is driven by the balance of benefits and costs. Laziness is built deep into our nature.”
Tuesday, 7 May 13
Personal experienceNegative experienceFundamental attribution error
Tuesday, 7 May 13
Moore’s lawTuesday, 7 May 13
every 2 years the number of transistors increasesThis has also mapped to hard drives and clock speed.
2008
Tuesday, 7 May 13
2008
2011
412 Hz 1 GHzDual-Core
Tuesday, 7 May 13
Wirth’s lawTuesday, 7 May 13
Wirth’s lawGate’s law
Tuesday, 7 May 13
Wirth’s lawGate’s lawMay’s law
Tuesday, 7 May 13
Wirth’s lawGate’s lawMay’s lawPage’s law
Tuesday, 7 May 13
Offset Moore’s lawTuesday, 7 May 13 "software is getting slower more rapidly than hardware becomes faster." this was said in 1995 the year java was released.
JS’s moore law?Tuesday, 7 May 13
As javascript get engines get faster, developers will increase double the size of their libraries every 2 years.This is 2010 to 2013, so it almost lines up.
More complex?Tuesday, 7 May 13
http://upload.wikimedia.org/wikipedia/commons/5/52/Pdp7-oslo-2005.jpeg
Tuesday, 7 May 13
Peter Samson
200 kilohertz
16K
Well, Why?Tuesday, 7 May 13
Constraints drive creativity
Tuesday, 7 May 13
The Somebody Else's Problem Field is a field running on the principle that if something is identified to be somebody else's problem, the brain will edit it out of the person's vision. - Adams
Tuesday, 7 May 13
We have invented phrases that our somebody elses problem’
Ship it. premature optimization...
Back to basicsTuesday, 7 May 13
$(“#selector”);
Tuesday, 7 May 13
BigO
Tuesday, 7 May 13
O(n)Tuesday, 7 May 13
654321 1110987
Tuesday, 7 May 13
654321 1110987
Tuesday, 7 May 13
O(1)Tuesday, 7 May 13
654321 1110987
Tuesday, 7 May 13
654321 1110987
Tuesday, 7 May 13
O(n^2)Tuesday, 7 May 13
654321 1110987
654321 1110987
Tuesday, 7 May 13
654321 1110987
654321 1110987
Tuesday, 7 May 13
O(logn)Tuesday, 7 May 13
10
Tuesday, 7 May 13
104
Tuesday, 7 May 13
104
Tuesday, 7 May 13
10
4
Tuesday, 7 May 13
10
4
15
Tuesday, 7 May 13
10
4
15
Tuesday, 7 May 13
10
4 15
Tuesday, 7 May 13
10
4 15
2 5 11 25
Tuesday, 7 May 13
104
D Y
4O 4N
T A
Tuesday, 7 May 13
o(K) complexity based on lenght of key, not the data. Kind of neat.
O(n log n)
Tuesday, 7 May 13
similar to o n log n but every time we half the work, we need to iterate through a constant.
FunctionalTuesday, 7 May 13
FunctionalTuesday, 7 May 13
Not function()alTuesday, 7 May 13
Tuesday, 7 May 13
Tuesday, 7 May 13
λx.x
Tuesday, 7 May 13
(λx.x) y
Tuesday, 7 May 13
(λx.x) 5
Tuesday, 7 May 13
(λx.x) 5
Tuesday, 7 May 13
5
Tuesday, 7 May 13
Maths is not programming!
Tuesday, 7 May 13
Lambda { |x| x }x => x
Tuesday, 7 May 13
λx. λy .( x + y)
Tuesday, 7 May 13
λy .( 5 + y)
Tuesday, 7 May 13
First class functions!
Tuesday, 7 May 13
function(x) { function(y) { return x + y; }}
Tuesday, 7 May 13
1930
Tuesday, 7 May 13
1975
Tuesday, 7 May 13
Although it was written in some academic papers earlier.
(define (add a) (lambda (b) (+ a b)))
Tuesday, 7 May 13
Side effectsTuesday, 7 May 13
(λx.x) 5
Tuesday, 7 May 13
x => 5
Tuesday, 7 May 13
Referential transparency
Tuesday, 7 May 13
Was actually a term phrased by a philisopher quine.
1960
Change reference. Same context.
Tuesday, 7 May 13
I drank some delicious <>
Tuesday, 7 May 13
I drank some delicious alcohol from scotland.
Tuesday, 7 May 13
I drank some delicious scotch.
Tuesday, 7 May 13
function id(x) { return x;}
Tuesday, 7 May 13
10 + id(5);
Tuesday, 7 May 13
10 + 5;
Tuesday, 7 May 13
function id(x) { y = 30; updateDB(y,x); return x;}
Tuesday, 7 May 13
Sanity
Tuesday, 7 May 13
Higher order programming
Tuesday, 7 May 13
Map
Tuesday, 7 May 13
[-60, -10, -20].map(Math.abs)[-60, -10, -20].map(Math.abs)
[60, 10, 20]
Tuesday, 7 May 13
Filter
Tuesday, 7 May 13
[-60, 10, -20].filter(function(x) { return x > 0});
[10]
Tuesday, 7 May 13
Reduce
Tuesday, 7 May 13
[10, 20,30] .reduce(function(seed, x) { return seed + x }, 0);
60
Tuesday, 7 May 13
1 2 3 4
f(0, 1)
0+1
Tuesday, 7 May 13
1 2 3 4
f(1, 2)
1+2
Tuesday, 7 May 13
1 2 3 4
f(3, 3)
3+3
Tuesday, 7 May 13
1 2 3 4
f(6, 4)
6+4
Tuesday, 7 May 13
Tuesday, 7 May 13December, 2004.
Jeffrey Dean
Jeff Dean puts his pants on one leg at a time, but if he had more legs, you would see that his approach is O(log n).
interface Func<A, B> {
B apply(A x);}
Tuesday, 7 May 13
b = 1;
new Func<Integer, Integer>() {public Integer apply(Integer x) { return x + b; }}
Tuesday, 7 May 13
Syntax mattersTuesday, 7 May 13
Abstract conceptTuesday, 7 May 13
Higher higher order programming
Tuesday, 7 May 13
MonadsTuesday, 7 May 13
s/Maybe/MaybeMonadTuesday, 7 May 13
Chain = bind
>>=
Tuesday, 7 May 13
Of = return
Tuesday, 7 May 13
3 Laws.
Tuesday, 7 May 13
Standards +Academia +Javascript =
Tuesday, 7 May 13
Tuesday, 7 May 13
Fantasy landTuesday, 7 May 13
It was so named after the infamous bug 94 on the promises spec
Dealing with null.
Free.Tuesday, 7 May 13
By adhering to these specs we start go get some things for free.For example in my previous maybe example i wrote map. We don’t actually have to do that. It can be implmented for us. Same with a whole host of functions Lift for example which takes a function and runs it in the monadic context.Again we don’t have to worry about writing any of this, we get it for free.
We get assurances to an extent that these operations will run. Regardless of where or what the monad is dealing with.Just freedom. Is this not the idea of the lazy developer and comforms to DRY, LRU etc etc etc
Unfortuantly we can not get 100% assurance if we were to do this, we would need to rely on another concept from the early computer science days...
Types
Tuesday, 7 May 13
Types can take this concept even further.We don’t have to worry about people doing stupid things with our code as we can remove this ability for them
Still need tests
Tuesday, 7 May 13
Tests are slow
Tuesday, 7 May 13
Just less
Tuesday, 7 May 13
Javascript is untypedTuesday, 7 May 13
Sort ofTuesday, 7 May 13
1 TypeTuesday, 7 May 13
Value Tuesday, 7 May 13
A type system is a tractable syntacticmethod for proving the absence of certainprogram behaviors by classifying phrases
according to the kinds of values theycompute.
Tuesday, 7 May 13
A type system is a tractable syntacticmethod for proving the absence of certainprogram behaviors by classifying phrases
according to the kinds of values theycompute.
Tuesday, 7 May 13
tractable easy to control
A type system is a tractable syntacticmethod for proving the absence of certainprogram behaviors by classifying phrases
according to the kinds of values theycompute.
Tuesday, 7 May 13
15 + 5
Tuesday, 7 May 13
a -> a
Tuesday, 7 May 13
a -> a -> a
Tuesday, 7 May 13
string -> string
Tuesday, 7 May 13
function(string) { return string;}
Tuesday, 7 May 13
[a] -> a
Tuesday, 7 May 13
[string] -> string
Tuesday, 7 May 13
Sanity
Tuesday, 7 May 13
function add(a,b) { return a + b;}
Tuesday, 7 May 13
add(1,2)
Tuesday, 7 May 13
Tuesday, 7 May 13
add(“1”,2)
Tuesday, 7 May 13
Tuesday, 7 May 13
REX.W movq rax,[rbp+0x18] test al,0x1
+JS
Tuesday, 7 May 13
ASM.JS
Tuesday, 7 May 13
Tuesday, 7 May 13