the browser is dead… - goto...

21
THE BROWSER IS DEAD… Dan North Dan North & Associates

Upload: hadiep

Post on 29-Mar-2018

217 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

THE BROWSER IS DEAD…

Dan North

Dan North & Associates

Page 2: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

…LONG LIVE THE BROWSER!

Dan North

Dan North & Associates

Page 3: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

The gangs

1990: Tim Berners-Lee - (WorldWideWeb) 1993: NCSA – Mosaic 1994: Netscape - Navigator 1995: Microsoft - Internet Explorer 1996: Opera – Opera 1997: Netscape - Communicator … 2004: Mozilla - Firefox 2008: Google - Chrome

@tastapod

Page 4: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

The tech

1991-1995: HTTP, HTML, cookies, SSL, JavaScript 1996: Java applets, Flash, XML 1997: HTML 4, CSS 1999: AJAX (XMLHttpRequest) 2001-2006: SVG, Canvas

@tastapod

http://www.evolutionoftheweb.com

Page 5: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

The tech

2008-now – Everything else!

– Graphics: 2D and 3D transforms, WebGL, CSS3

– Client-side storage: localStorage and indexedDB

– Server-sent I/O: WebSockets and EventSource

– ECMAScript: fast JavaScript and DOM manipulation

@tastapod

http://www.evolutionoftheweb.com

Page 6: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

Your humble narrator

1987-1991 – Pyramid OS/x: elm, telnet, ftp

1991-1993 – Usenet

1992 – First time I saw the worldwide web

Me: meh!

oops

1997 – First time I saw Enterprise Java

Me: meh!

just saying…

@tastapod

Page 7: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

What is a browser for?

Rendering J2EE servlet output Displaying <blink>brochure web sites<marquee> Then suddenly… - Google Maps disrupts streetmap.co.uk - GMail disrupts HotMail and Yahoo! - Google Docs disrupts Microsoft Office

For an ad company, Google really knows its tech!

@tastapod

Page 8: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

Rule 1: Everything is asynchronous

Request-response is just selfish programming – “You can wait for me, because I’m important”

Corollary:

– Modal dialogs are rude – Surprise modal dialogs are ruder

Wild-assed theory: – That’s why people like node.js (plus RINSWAN)

Assume you’re not the most important thing @tastapod

Page 9: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

Let’s look at that response

The server sends it to you

– maybe you asked for it

– maybe it just cares about you

It’s no use unless you can see it

So the browser renders it for you

@tastapod

Page 10: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

Ceci n’est pas un page

@tastapod

Page 11: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

A brief history of templating

J2EE had JSP, then velocity, stringtemplate

– compile into a function that emits HTML

Rails had ERB, moustache, partials

– compile into a function that emits HTML

Django has the Django template system

– compiles into a function that emits HTML

@tastapod

Page 12: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

We try to get better at templating

We’re combining the template and the data on the server

Separation of concerns 101

@tastapod

Page 13: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

Rule 2: The DOM is the template

Let’s have an example

jQuery knows about DOMs so you don’t have to!

@tastapod

Page 14: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

So where does that leave the server?

Serving data!

And a new generation of app servers is born: – sinatra – flask – webbit – express, connect

@tastapod

Page 15: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

Rule 3: the server serves data

Not objects

Certainly not “transfer objects”

Let’s have an example

JSON = JavaScript Object Notation?

@tastapod

Page 16: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

Rule 3: the server serves data

Not objects

Certainly not “transfer objects”

Let’s have an example

JavaScript Structured Data Notation

@tastapod

Page 17: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

But it still looks a bit 1999…

Remember I said I was rubbish at design?

Let’s have an example

Bootstrap knows about styling so you don’t have to!

@tastapod

Page 18: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

Rule 4: Someone already solved it

The DOM – jQuery, sizzle, zepto

– knockout, backbone, angular

JavaScript – underscore

CSS – bootstrap, skeleton, 960grid

@tastapod

Page 19: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

I didn’t talk about…

URLs and history

The browser as IDE

The community

Ubiquitous JavaScript

@tastapod

Page 20: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

So what have I learned?

The DOM is a template – learn to use it!

Everything is an event

You can work truly outside-in

It pays to be late to the party

@tastapod

Page 21: THE BROWSER IS DEAD… - GOTO Conferencegotocon.com/dl/goto-aar-2012/slides/DanNorth_TheBrowserIsDead.pdf · Dan North Dan North & Associates …LONG LIVE THE BROWSER! Dan North Dan

Go code web apps!

@tastapod

http://dannorth.net

[email protected]

@tastapod