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

Rails and the future of the open web

Rails and the future of the open web

Slides (without notes) for a guest lecture at the University of Applied Sciences in Oulu.

Florian Plank

April 01, 2014
Tweet

More Decks by Florian Plank

Other Decks in Programming

Transcript

  1. &
    RUBY ON RAILS
    The Future of the Open Web

    View Slide

  2. THE
    OPEN WEB
    RUBY
    RUBY ON RAILS
    1 2

    View Slide

  3. 1 2
    3

    View Slide

  4. nicolasrapp.com
    THE OPEN WEB

    View Slide

  5. Knowledge
    Communication
    Work
    Social connections
    News
    Tool for political change
    RICHARD DARELL — bitrebels.com

    View Slide

  6. “The Internet’s great promise is to make the
    world’s information universally
    accessible and useful.”
    (GARY WOLF)

    View Slide

  7. “OPENNESS”

    View Slide

  8. OPEN STANDARDS
    Non-proprietary
    Content, implementation and access

    View Slide

  9. vs.
    EXAMPLE

    View Slide

  10. PHILOSOPHY
    Decentralization
    Transparency
    Hackability
    Openness
    From Gift Economies to Free Markets
    Third-Party Innovation
    Civil Society and Discourse
    End-User Usability and Integration
    BRAD NEUBERG — codinginparadise.org

    View Slide

  11. STATE OF THE UNION

    View Slide

  12. View Slide

  13. THE WEB IN 2014
    Threats and Opportunities

    View Slide

  14. “I love the Internet, and I love that you can say
    whatever you want.”
    (JOAN RIVERS)

    View Slide

  15. SURVEILLANCE

    View Slide

  16. View Slide

  17. “The NSA’s surveillance programme is prompting
    many US writers to abandon topics that could be
    deemed too sensitive”
    (DAVE EGGERS, theguardian.com)

    View Slide

  18. CENSORSHIP

    View Slide

  19. View Slide

  20. View Slide

  21. GOVERNMENT ONLINE

    View Slide

  22. View Slide

  23. View Slide

  24. NET NEUTRALITY

    View Slide

  25. View Slide

  26. CYBER ACTIVISM

    View Slide

  27. View Slide

  28. SECURITY

    View Slide

  29. View Slide

  30. “TECHNOMONOPOLIES”

    View Slide

  31. View Slide

  32. POST–INDUSTRIAL SOCIETIES

    View Slide

  33. CROWD SOURCING & FUNDING

    View Slide

  34. THE WEB AS SOCIAL NORMALIZER

    View Slide

  35. THE WEB IN 2014
    Design and Technology

    View Slide

  36. MOBILE & OFFLINE FIRST

    View Slide

  37. ASYNCHRONOUS WEB

    View Slide

  38. THE INTERNET OF THINGS

    View Slide

  39. BIG (SOCIAL) DATA

    View Slide

  40. MONETIZATION IN A
    MULTISCREEN PARADIGM

    View Slide

  41. RUBY & RUBY ON RAILS

    View Slide

  42. Yukihiro “Matz” Matsumoto

    View Slide

  43. “I hope to see Ruby help every programmer in the
    world to be productive, and to enjoy programming,
    and to be happy. That is the primary purpose of
    Ruby language.”
    (MATZ)

    View Slide

  44. PRINCIPLES
    Programmer happiness
    Principle of least astonishment
    Human readable
    Beautiful syntax

    View Slide

  45. ECOSYSTEM
    RubyGems, Bundler & Rake
    Multiple implementations (MRI, JRuby, Rubinius,
    mruby, MacRuby, Topaz, …)
    Solid Standard Library

    View Slide

  46. COMMUNITY
    MINASWAN
    Self reflective
    Open
    Quirky

    View Slide

  47. View Slide

  48. OBJECT–ORIENTED

    View Slide

  49. 5.times { print "We love Ruby" }

    View Slide

  50. class Animal
    def eat(food)
    puts "Animal eating"
    end
    end
    my_animal = Animal.new
    animal.eat
    # => "Animal eating"

    View Slide

  51. class Dog < Animal
    def eat(food)
    puts "Dog eating"
    super
    end
    end

    View Slide

  52. module Stomach
    def digest(food)
    # ...
    end
    end

    View Slide

  53. class Dog < Animal
    include Stomach
    end
    my_dog = Dog.new
    dog.digest

    View Slide

  54. -199.abs
    # => 199
    "Foobar".split("").uniq.sort.join
    # => "abFor"
    nil.class
    # => "NilClass"

    View Slide

  55. DYNAMICALLY TYPED
    (DUCK–TYPING)

    View Slide

  56. if dog.is_a? Animal
    dog.eat
    end
    dog.eat if dog.respond_to?(:eat)

    View Slide

  57. MONKEY–PATCHING
    (DUCK–PUNCHING)

    View Slide

  58. “… if it walks like a duck and talks like a duck,
    it’s a duck, right? So if this duck is not giving you
    the noise that you want, you’ve got to just punch
    that duck until it returns what you expect.”

    View Slide

  59. class String
    def yell
    "#{self.upcase}!"
    end
    end
    "hello".yell
    # => "HELLO!"

    View Slide

  60. META–PROGRAMMING

    View Slide

  61. class Greeter
    def method_missing(name, *args)
    name = name.to_s
    if name =~ /^hello_/
    puts "Hello, #{name.gsub(/^hello_/, '')}!"
    else
    super
    end
    end
    end
    Greeter.new.hello_john
    # => "Hello, john!"

    View Slide

  62. BLOCKS & LAMBDAS

    View Slide

  63. [1, 2, 3].map { |i| i ** 2 }
    # => [1, 4, 9]

    View Slide

  64. def greet(&block)
    # ...
    greeting = yield("John")
    # ...
    end
    greet do |name|
    "Hello, #{name}!"
    end

    View Slide

  65. View Slide

  66. PRINCIPLES
    Open Source
    MVC
    CoC
    DRY
    Opinionated

    View Slide

  67. CONTROLLER
    MODEL VIEW

    View Slide

  68. FEATURES
    Generators
    ORM
    Restful routing
    Included web server

    View Slide

  69. ROUTES
    CONTROLLER ACTION

    View Slide

  70. $ gem install rails
    $ rails new blog
    $ cd blog
    $ rails generate scaffold post title content:text
    $ rake db:migrate
    $ rails server

    View Slide

  71. [CODE TOUR]

    View Slide

  72. RUBY ON RAILS
    AND THE OPEN WEB

    View Slide

  73. THREATS AND OPPORTUNITIES

    View Slide

  74. EMPOWERMENT

    View Slide

  75. “The solution is open source. By building together
    open, free, secure systems, we can go around such
    surveillance, and then one country doesn't have to
    solve the problem by itself.”
    (MIKKO HYPPÖNEN)

    View Slide

  76. Open Source
    A strong, independent community
    Well developed ecosystem

    View Slide

  77. DECENTRALIZATION

    View Slide

  78. Availability
    Deployment
    Development speed

    View Slide

  79. SECURITY

    View Slide

  80. Convention over configuration
    Open Source
    Ecosystem

    View Slide

  81. DESIGN AND TECHNOLOGY

    View Slide

  82. OPENNESS

    View Slide

  83. Rails API
    RESTful by default
    Database agnosticism

    View Slide

  84. SHIFTING TOWARDS THE CLIENT

    View Slide

  85. Sass
    CoffeeScript
    Asset Pipeline
    Turbolinks

    View Slide

  86. ASYNCHRONOUS WEB

    View Slide

  87. SSE
    JRuby
    Threadsafe by default
    Celluloid
    Live streaming

    View Slide

  88. @polarblau

    View Slide