SlideShare a Scribd company logo
1 of 130
Download to read offline
See the tries for the trees
http://www.flickr.com/photos/zoer/2363020211/
Tuesday, 7 May 13
3
Tuesday, 7 May 13
Tuesday, 7 May 13
Add fast moving images
Tuesday, 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 physical
exertion. The law asserts that if there are several ways of achieving the
same goal, people will eventually gravitate to the least demanding course
of action. In the economy of action, effort is a cost, and the acquisition of
skill is driven by the balance of benefits and costs. Laziness is built deep into our nature.”
Tuesday, 7 May 13
Personal experience
Negative experience
Fundamental attribution error
Tuesday, 7 May 13
Moore’s law
Tuesday, 7 May 13
every 2 years the number of transistors increases
This has also mapped to hard drives and clock speed.
2008
Tuesday, 7 May 13
2008
2011
412 Hz 1 GHz
Dual-Core
Tuesday, 7 May 13
Wirth’s law
Tuesday, 7 May 13
Wirth’s law
Gate’s law
Tuesday, 7 May 13
Wirth’s law
Gate’s law
May’s law
Tuesday, 7 May 13
Wirth’s law
Gate’s law
May’s law
Page’s law
Tuesday, 7 May 13
Offset Moore’s law
Tuesday, 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 basics
Tuesday, 7 May 13
$(“#selector”);
Tuesday, 7 May 13
Big
OTuesday, 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.
Functional
Tuesday, 7 May 13
Functional
Tuesday, 7 May 13
Not function()al
Tuesday, 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 effects
Tuesday, 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 13
December, 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 matters
Tuesday, 7 May 13
Abstract concept
Tuesday, 7 May 13
Higher higher
order programming
Tuesday, 7 May 13
Monads
Tuesday, 7 May 13
s/Maybe/MaybeMonad
Tuesday, 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 land
Tuesday, 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 untyped
Tuesday, 7 May 13
Sort of
Tuesday, 7 May 13
1 Type
Tuesday, 7 May 13
Value
Tuesday, 7 May 13
A type system is a tractable syntactic
method for proving the absence of certain
program behaviors by classifying phrases
according to the kinds of values they
compute.
Tuesday, 7 May 13
A type system is a tractable syntactic
method for proving the absence of certain
program behaviors by classifying phrases
according to the kinds of values they
compute.
Tuesday, 7 May 13
tractable easy to control
A type system is a tractable syntactic
method for proving the absence of certain
program behaviors by classifying phrases
according to the kinds of values they
compute.
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

More Related Content

Similar to Web directions code 13 notes

Designing for garbage collection
Designing for garbage collectionDesigning for garbage collection
Designing for garbage collection
Gregg Donovan
 
Advanced business models i catapult
Advanced business models   i catapultAdvanced business models   i catapult
Advanced business models i catapult
Founder-Centric
 

Similar to Web directions code 13 notes (16)

Bring the Noise
Bring the NoiseBring the Noise
Bring the Noise
 
How We Look At Software
How We Look At SoftwareHow We Look At Software
How We Look At Software
 
Clojure night
Clojure nightClojure night
Clojure night
 
PostgreSQL Hooks for Fun and Profit
PostgreSQL Hooks for Fun and ProfitPostgreSQL Hooks for Fun and Profit
PostgreSQL Hooks for Fun and Profit
 
Taming Pythons with ZooKeeper
Taming Pythons with ZooKeeperTaming Pythons with ZooKeeper
Taming Pythons with ZooKeeper
 
The Shape of Functional Programming
The Shape of Functional ProgrammingThe Shape of Functional Programming
The Shape of Functional Programming
 
Scalable JavaScript
Scalable JavaScriptScalable JavaScript
Scalable JavaScript
 
Implementing the Split-Apply-Combine model in Clojure and Incanter
Implementing the Split-Apply-Combine model in Clojure and Incanter Implementing the Split-Apply-Combine model in Clojure and Incanter
Implementing the Split-Apply-Combine model in Clojure and Incanter
 
batou - multi(component|host|environment|.*) deployment
batou - multi(component|host|environment|.*) deploymentbatou - multi(component|host|environment|.*) deployment
batou - multi(component|host|environment|.*) deployment
 
Designing for garbage collection
Designing for garbage collectionDesigning for garbage collection
Designing for garbage collection
 
Storyplayer
StoryplayerStoryplayer
Storyplayer
 
Lessons learned from Node.js - Callbacks / Promises
Lessons learned from Node.js - Callbacks / PromisesLessons learned from Node.js - Callbacks / Promises
Lessons learned from Node.js - Callbacks / Promises
 
The Seneca Pattern at EngineYard Distill 2013 Conference
The Seneca Pattern at EngineYard Distill 2013 ConferenceThe Seneca Pattern at EngineYard Distill 2013 Conference
The Seneca Pattern at EngineYard Distill 2013 Conference
 
Social Interfaces
Social InterfacesSocial Interfaces
Social Interfaces
 
Advanced business models i catapult
Advanced business models   i catapultAdvanced business models   i catapult
Advanced business models i catapult
 
My mom told me that Git doesn’t scale by Vicent Martí
My mom told me that Git doesn’t scale by Vicent MartíMy mom told me that Git doesn’t scale by Vicent Martí
My mom told me that Git doesn’t scale by Vicent Martí
 

Recently uploaded

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 

Web directions code 13 notes