WebFund 2015W Lecture 23

From Soma-notes
Revision as of 18:01, 4 April 2015 by Soma (talk | contribs)

Audio

The audio from the lecture given on April 1, 2015 is now available.

Notes

Two topics for last two lectures:

  • What are the fundamentals of web applications?
  • Web applications everywhere

Distributed Applications

Applications that run on multiple computers

  • separate memory, CPU, storage, communication (I/O)
  • can apply this processes, virtual hosts, or physical hosts

Localhost is useful when you want a distributed app on one computer

  • GET and POST can go essentially anywhere on the Internet
  • allows for flexible combination of code and data
  • web applications are the premier form of distributed applications today
  • with distributed applications, you don't control all the computers "your" code runs on

Structured Persistence

Before this class, you worked with files

Files are unstructured (on modern systems)

On the web we use "databases"

  • really, structured storage

Why structured?

  • convenience
  • speed for "complex" queries
  • concurrency & distribution

Front vs Back end

  • separate parts of app for...
    • doing computation/storage/real work (back end)
    • providing the interface (front end)

Can you do "real work" in the front end?

  • Yes, but...
  • Don't trust the answers

Front end is untrusted, back end is trusted

Modern web apps have many backends and can have multiple front ends (mobile, desktop)

  • but "responsive design" says you should have one front end

So why put stuff in the front end?

  • lower the load on the back end
  • but main reason is latency (of network communication)

Markup and Templates

HTML, CSS: markup Jade: template language

Markup is constraint or declarative programming

template languages output markup (are meta-markup)

Trust

Who do you trust?

  • library, runtime authors
  • content providers
  • ad providers
  • whatever else you add to a page

Trust means "who can screw you over"

  • if they go bad how badly are you hurt

Amazing the web works at all