Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Making Sense of Web Frameworks

Making Sense of Web Frameworks

Presented at GLSEC 2015 in Grand Rapids, Michigan on 11 May 2015.

Daniel Morrison

May 11, 2015
Tweet

More Decks by Daniel Morrison

Other Decks in Programming

Transcript

  1. collectiveidea.com #1: Pick by Language ! Quicker to learn !

    Easier to “sell” ! Limits your choices " Wrong for goals? " Baggage " Limits your choices
  2. collectiveidea.com #2: Popularity “For the fourth year in a row,

    Python retains it's #1 dominance followed by Java, C++, and Javascript.”
  3. collectiveidea.com #2: Popularity ! Lots of resources ! Excitement !

    Active community " May change too fast " May change too slow " Not battle-tested " Fewer experts " Is it actually used?
  4. collectiveidea.com #3: Type ! Right tool for the job !

    Focus on features ! Optimize for Env " May be new Language " Difficulties may arise " New toolchains
  5. collectiveidea.com 4: Ecosystem ! Find helpful people ! Easy to

    research ! May be friendly expats " Safety bias " Miss innovations " Different styles
  6. collectiveidea.com Server Side • Server Generated Code • Stateless •

    Model View Controller • Database ORM • Routing
  7. collectiveidea.com class!ArticlesController!<!ApplicationController
 !!#!GET!/articles
 !!#!GET!/articles.json
 !!def!index
 !!!!@articles!=!Article.all
 !!end
 
 !!#!GET!/articles/1
 !!#!GET!/articles/1.json


    !!def!show
 !!!!@article!=!Article.find(params[:id])
 !!end
 
 !!#!GET!/articles/new
 !!def!new
 !!!!@article!=!Article.new
 !!end
 !#!extra!lines!omitted.! end
  8. collectiveidea.com <section!id="main">
 !!{{#if!canToggle}}
 !!!!{{input!type="checkbox"!id="toggle\all"!checked=allTodos.allAreDone}}
 !!{{/if}}
 !!<ul!id="todo\list">
 !!!!{{#each}}
 !!!!!!<li!{{bind\attr!class="isCompleted:completed!isEditing:editing"}}>
 !!!!!!!!{{#if!isEditing}}
 !!!!!!!!!!{{todo\input!type="text"!class="edit"!value=bufferedTitle!

    !!!!!!!!!!!!focus\out="doneEditing"!insert\newline="doneEditing"! !!!!!!!!!!!!escape\press="cancelEditing"}}
 !!!!!!!!{{else}}
 !!!!!!!!!!{{input!type="checkbox"!class="toggle"!checked=isCompleted}}
 !!!!!!!!!!<label!{{action!"editTodo"!on="doubleClick"}}>{{title}}</label>
 !!!!!!!!!!<button!{{action!"removeTodo"}}!class="destroy"></button>
 !!!!!!!!{{/if}}
 !!!!!!!!</li>
 !!!!{{/each}}
 !!</ul>
 </section>
  9. collectiveidea.com Client Side • No server code needed • Rich,

    stageful interfaces • Interfaces feel responsive • Logic runs in the browser
  10. collectiveidea.com Router.map(function()!{
 !!this.route('join');
 !!this.route('signin');
 
 !!this.route('listsShow',!{
 !!!!path:!'/lists/:_id',
 !!!!//!subscribe!to!todos!before!the!page!is!rendered!but!don't!wait!on!the
 !!!!//!subscription,!we'll!just!render!the!items!as!they!arrive
 !!!!onBeforeAction:!function!()!{


    !!!!!!this.todosHandle!=!Meteor.subscribe('todos',!this.params._id);
 
 !!!!!!if!(this.ready())!{
 !!!!!!!!//!Handle!for!launch!screen!defined!in!app\body.js
 !!!!!!!!dataReadyHold.release();
 !!!!!!}
 !!!!},
 !!!!data:!function!()!{
 !!!!!!return!Lists.findOne(this.params._id);
 !!!!},
 !!!!action:!function!()!{
 !!!!!!this.render();
 !!!!}
 !!});
 
 !!this.route('home',!{
 !!!!path:!'/',
 !!!!action:!function()!{
 !!!!!!Router.go('listsShow',!Lists.findOne());
 !!!!}
 !!});
 });
  11. collectiveidea.com Server Side • Most common choice • Request-response cycle

    • Mature frameworks • Avoid Javascript (if you want)
  12. collectiveidea.com Client Side • Newer and less information • Especially

    great if simply calculating • May feel more familiar to desktop coders • May require server side anyway
  13. collectiveidea.com Image Credits • Untitled by kris krüg
 https://www.flickr.com/photos/kk/6863172432 •

    The empty room by Antoine Robiez
 https://www.flickr.com/photos/enthuan/9317165351 • Wild West Hotel by Marion Doss
 https://www.flickr.com/photos/ooocha/2594791354