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 full-size slide

  2. THE
    OPEN WEB
    RUBY
    RUBY ON RAILS
    1 2

    View full-size slide

  3. nicolasrapp.com
    THE OPEN WEB

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  6. “OPENNESS”

    View full-size slide

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

    View full-size slide

  8. 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 full-size slide

  9. STATE OF THE UNION

    View full-size slide

  10. THE WEB IN 2014
    Threats and Opportunities

    View full-size slide

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

    View full-size slide

  12. SURVEILLANCE

    View full-size slide

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

    View full-size slide

  14. GOVERNMENT ONLINE

    View full-size slide

  15. NET NEUTRALITY

    View full-size slide

  16. CYBER ACTIVISM

    View full-size slide

  17. “TECHNOMONOPOLIES”

    View full-size slide

  18. POST–INDUSTRIAL SOCIETIES

    View full-size slide

  19. CROWD SOURCING & FUNDING

    View full-size slide

  20. THE WEB AS SOCIAL NORMALIZER

    View full-size slide

  21. THE WEB IN 2014
    Design and Technology

    View full-size slide

  22. MOBILE & OFFLINE FIRST

    View full-size slide

  23. ASYNCHRONOUS WEB

    View full-size slide

  24. THE INTERNET OF THINGS

    View full-size slide

  25. BIG (SOCIAL) DATA

    View full-size slide

  26. MONETIZATION IN A
    MULTISCREEN PARADIGM

    View full-size slide

  27. RUBY & RUBY ON RAILS

    View full-size slide

  28. Yukihiro “Matz” Matsumoto

    View full-size slide

  29. “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 full-size slide

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

    View full-size slide

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

    View full-size slide

  32. COMMUNITY
    MINASWAN
    Self reflective
    Open
    Quirky

    View full-size slide

  33. OBJECT–ORIENTED

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  40. DYNAMICALLY TYPED
    (DUCK–TYPING)

    View full-size slide

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

    View full-size slide

  42. MONKEY–PATCHING
    (DUCK–PUNCHING)

    View full-size slide

  43. “… 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 full-size slide

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

    View full-size slide

  45. META–PROGRAMMING

    View full-size slide

  46. 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 full-size slide

  47. BLOCKS & LAMBDAS

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  50. PRINCIPLES
    Open Source
    MVC
    CoC
    DRY
    Opinionated

    View full-size slide

  51. CONTROLLER
    MODEL VIEW

    View full-size slide

  52. FEATURES
    Generators
    ORM
    Restful routing
    Included web server

    View full-size slide

  53. ROUTES
    CONTROLLER ACTION

    View full-size slide

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

    View full-size slide

  55. RUBY ON RAILS
    AND THE OPEN WEB

    View full-size slide

  56. THREATS AND OPPORTUNITIES

    View full-size slide

  57. “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 full-size slide

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

    View full-size slide

  59. DECENTRALIZATION

    View full-size slide

  60. Availability
    Deployment
    Development speed

    View full-size slide

  61. Convention over configuration
    Open Source
    Ecosystem

    View full-size slide

  62. DESIGN AND TECHNOLOGY

    View full-size slide

  63. Rails API
    RESTful by default
    Database agnosticism

    View full-size slide

  64. SHIFTING TOWARDS THE CLIENT

    View full-size slide

  65. Sass
    CoffeeScript
    Asset Pipeline
    Turbolinks

    View full-size slide

  66. ASYNCHRONOUS WEB

    View full-size slide

  67. SSE
    JRuby
    Threadsafe by default
    Celluloid
    Live streaming

    View full-size slide